Jump to content

  • Log In with Google      Sign In   
  • Create Account


OXY - A programming language


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
9 replies to this topic

#1 ellisvlad   Members   -  Reputation: 155

Posted 31 March 2013 - 06:30 AM

Hi there, my name is Vlad Ellis, and for the past few months I have been planning on writing a programming language. On the first of this month, I actually started programming the project, and progress so far has been great! There is a working compiler and interpreter, which are capable of compiling and running some basic operations. So far I have implemented setting and freeing variables, if/else/for/while, math (using +-*/() and variables), and function calling. The next challenge now is to add function definitions, objects and included files.

So far the language is very fast, and is working as intended. I hope to finish everything mentioned above and test it some more by the end of next month. :D I will then post binaries for both the compiler and runner here for anyone to test and play around with (Windows only for now)

In the future, I will remove the need for a separate runner, and the compiler will output .Exe files. I also hope to start writing an IDE for the language some time toward the end of next month, which probably won't be ready for testing by the end of the month, but I will definitely post some screenshots of it.

So my questions to this community...
- Is writing my own programming language a good idea? It is mainly for educational purposes, but could become more?
- I have seen some projects like this in the past, and normally the developers sell their cross platform compiler for a lot of money ($1,000+), and their languages are almost always slow and the compiled .exe is often bulky (4MB for an almost empty project?!) would it be realistic to try and sell my finished compiler? (for much much less of course!)
- Am I wasting my time on this? :S
- What is important to see in a programming language? (Functions, object-oriented, etc.)
- Any other general feedback or comments/questions would be great :D

Thank you for reading!

Sponsor:

#2 sethhope   Members   -  Reputation: 331

Posted 03 April 2013 - 01:57 PM

I think it is great that you are pursuing such a complex project. If the language is fast, slim, and easy to use, I see you being able to sell it for a low price! I wish you luck with your project (I personally would love to see it when its finished) and hope that everything works well.

 

P.S. If you are learning from the experience, you are never wasting your time.


I develop to expand the universe.
"Live long and code strong!" - Delta_Echo (dream.in.code)

#3 Waterlimon   Crossbones+   -  Reputation: 2085

Posted 03 April 2013 - 02:03 PM

It would be great if it was easy to define your own control structures. Using something like C++11 lambdas for example. (like foreach({code}))
Would be even more interesting if you had syntax which woild allow yoi to create lets say a for loop, without it already existing.
for (code; code; moar code) {codeee}
The lack of awesome free resource gathering building sandbox games capable of running an user made 8 bit computer in the world disturbs me.

#4 Cornstalks   Crossbones+   -  Reputation: 6882

Posted 03 April 2013 - 02:32 PM

I'm not sure why this is in Your Announcements...

Is writing my own programming language a good idea? It is mainly for educational purposes, but could become more?

Yeah, it's a good idea from a purely educational perspective. Sure, it can become more, but there's a million languages out there so don't expect it to replace C++ or anything like that...

I have seen some projects like this in the past, and normally the developers sell their cross platform compiler for a lot of money ($1,000+), and their languages are almost always slow and the compiled .exe is often bulky (4MB for an almost empty project?!) would it be realistic to try and sell my finished compiler? (for much much less of course!)

I haven't seen any projects like this... you can try, but you've got a lot of free competition.

Am I wasting my time on this? :S

Are you learning?

What is important to see in a programming language? (Functions, object-oriented, etc.)

More functional features. Specifically, a good way to mix functional and imperative programming. Pure functional or pure imperative might sound nice in theory, but in practice (particularly for game programming, where speed and code architecture can make a huge difference) are difficult/limiting. Also, the ability to work with C libraries.

Any other general feedback or comments/questions would be great biggrin.png

Good luck!

Edited by Cornstalks, 03 April 2013 - 02:33 PM.

[ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]

#5 ellisvlad   Members   -  Reputation: 155

Posted 03 April 2013 - 03:16 PM

I think it is great that you are pursuing such a complex project. If the language is fast, slim, and easy to use, I see you being able to sell it for a low price! I wish you luck with your project (I personally would love to see it when its finished) and hope that everything works well.

P.S. If you are learning from the experience, you are never wasting your time.

:D made good progress this week. A tech demo by the end of the month is a very realistic goal ;)

It would be great if it was easy to define your own control structures. Using something like C++11 lambdas for example. (like foreach({code}))
Would be even more interesting if you had syntax which woild allow yoi to create lets say a for loop, without it already existing.
for (code; code; moar code) {codeee}

Foreach would be a fun challenge to program in ;) I will need to get arrays working first though ;)

I'm not sure why this is in Your Announcements...


Is writing my own programming language a good idea? It is mainly for educational purposes, but could become more?

Yeah, it's a good idea from a purely educational perspective. Sure, it can become more, but there's a million languages out there so don't expect it to replace C++ or anything like that...

I have seen some projects like this in the past, and normally the developers sell their cross platform compiler for a lot of money ($1,000+), and their languages are almost always slow and the compiled .exe is often bulky (4MB for an almost empty project?!) would it be realistic to try and sell my finished compiler? (for much much less of course!)

I haven't seen any projects like this... you can try, but you've got a lot of free competition.

Am I wasting my time on this? :S

Are you learning?

What is important to see in a programming language? (Functions, object-oriented, etc.)

More functional features. Specifically, a good way to mix functional and imperative programming. Pure functional or pure imperative might sound nice in theory, but in practice (particularly for game programming, where speed and code architecture can make a huge difference) are difficult/limiting. Also, the ability to work with C libraries.

Any other general feedback or comments/questions would be great :D

Good luck!
I wasn't sure where I should have put this post. Feel free to move it if it should go somewhere else.
So far, the language is purely functional, however, there are some inbuilt functions that just run blocks of internal code, e.g. Creating a window, loading a sprite/font.
But I am having great fun writing this, and I am learning a lot about C++ too.
(I am also starting to appreciate how clever the people who wrote the third generation languages must have been, it isn't easy!)

Great to see positive responses to my post :D. I was, until recently, doubtful that the project would be successful, and felt like giving up so many times, but to read that other people have interest in this language, even if you just want to see it working, is a great motivational boost for me. Thank you!

#6 Alpha_ProgDes   Crossbones+   -  Reputation: 4506

Posted 03 April 2013 - 04:01 PM

More functional features. Specifically, a good way to mix functional and imperative programming. Pure functional or pure imperative might sound nice in theory, but in practice (particularly for game programming, where speed and code architecture can make a huge difference) are difficult/limiting. Also, the ability to work with C libraries.

 

Something along the lines of Scala?


Beginner in Game Development? Read here.
 
Super Mario Bros clone tutorial written in XNA 4.0 [MonoGame, ANX, and MonoXNA] by Scott Haley
 
If you have found any of the posts helpful, please show your appreciation by clicking the up arrow on those posts Posted Image
 
Spoiler

#7 mikenovemberoscar   Members   -  Reputation: 215

Posted 04 April 2013 - 10:38 AM

Hi, I attempted to write my own language a while ago but I really got lost in complexity.

I'd really appreciate it if you could share any resources (tutorials, websites, etc) that you used, or if there was any really useful resources on writing a compiler or interpreter?

 

Thanks.



#8 ellisvlad   Members   -  Reputation: 155

Posted 05 April 2013 - 08:00 PM

Hi, I attempted to write my own language a while ago but I really got lost in complexity.
I'd really appreciate it if you could share any resources (tutorials, websites, etc) that you used, or if there was any really useful resources on writing a compiler or interpreter?
 
Thanks.


Hi mike, I would love to be able to post a long list of resources that I used when making the compiler, but the truth is, there aren't any good ones out there.. Before starting the compiler, I set out to find as many tutorials, guides, and other resources on how to go about making my own compiler...but I found nothing of use. Most of the time spent programming the compiler, I was offline, on my laptop, so I didn't have resources to go to..

The most important thing I have found with the project, and with many others, is to draw a diagram of how it is all going to work. With pseudo-code dotted around it if you think it will help to develop the diagram.

This is how OXY works right now.

1) input a text file with code in it
E.g. If (1==2) say(hi);
2) read the text file word by word (stopping at "; (" (those three characters, not the smily))
3) interpret the read data and add a branch to an element tree with the type of command, and any extra data (parameters)
4) walk through the generated tree, branch by branch, and output as a byte stream.
5) save the byte stream to a file. (This is your executable byte stream. Encrypt/compress/pack however you like now)
6) runner loads the executable byte stream and walks through it, executing what it says.

In essence, this is how OXY works, there are of course special cases (functions/classes) but those get coded in later ;)

#9 mikenovemberoscar   Members   -  Reputation: 215

Posted 20 April 2013 - 09:44 AM

Awesome thanks!



#10 Elchi   Members   -  Reputation: 717

Posted 20 April 2013 - 06:55 PM

Here's a decent tutorial:  http://llvm.org/docs/tutorial/


Edited by Elchi, 20 April 2013 - 06:56 PM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS