Orderly Mayhem
May 21, 2012, 01:40:46 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Contact Staff List Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: OLang  (Read 726 times)
OvermindDL1
Casual Support Developers
*
Offline Offline

Gender: Male
Posts: 278

Programmer


View Profile WWW
« on: August 16, 2008, 01:36:16 AM »

You know when I was talking about a made-up language from before, well I kept at it, the compiler works well, got some capabilities, but now I am working on the language parsing itself now, read the post on my forum for details:  http://www.overminddl1.com/forum/index.php/topic,845.msg5332.html#msg5332

As I am just now coming up with the language for it, now is the time for input.  When it is usable, I intend to use my language pretty heavily as it will be faster then just about any scripting language (still slightly slower then C++ in some cases, but faster in others, yes faster, but will have a better syntax, hence the purpose of now) and it is designed to be easily embeddable, like a scripting language, in any C++ app (I could pretty trivially make a C header for it as well, just will lose the type safety that templates provide, but as long as the user is smart, it would not have any issues).  So if you have ever had niggles or design issues with C/C++/etc.. that you would like to have seen done in a better way, now is the time.  If you ever think you might use it, all the more reason to be bigger in its design.  I have done far too much of the back-end to stop now, so you can be sure I will complete it.  If you have comments or what-not, please post them on my forum in that post if possible so I can archive them, but I will still read them here.

For note, if I make a game or program of something, I intend to fully implement the program into my app, only using C/C++ to bind objects for use into my language (OGRE will probably be one of the first things...), so I do intend it to be completely usable, and thanks to the back-end it is capable of outputting assembly to be compiled with yasm or whatever, and linked with a linker like gcc's or visual studio's.  I may make all that part of the process later on that users could use to completely compile a program in this language.  For external functions I do completely support the C ABI, the C++ ABI however, because it is different from every freaking compiler in existence (crappy standards in that regard...), and different very often between different versions of the same compiler, it is very unlikely I will support it, but I may add in support for some versions of some compilers, probably just some versions of gcc and visual studio if anything...
« Last Edit: August 16, 2008, 01:41:24 AM by OvermindDL1 » Logged

BS-er
Moderator of Mayhem
Administrator
*****
Offline Offline

Posts: 2150


View Profile
« Reply #1 on: August 16, 2008, 09:22:41 AM »

Cool!!  Now I see what you do with a lot of your time Smiley.  I already have a few niggles with C++ in mind.  There are also features of other languages such as Ada that I found useful.  I'll have a few comments for you in your forum thread soon.
Logged
OvermindDL1
Casual Support Developers
*
Offline Offline

Gender: Male
Posts: 278

Programmer


View Profile WWW
« Reply #2 on: August 16, 2008, 09:32:54 AM »

Ada is actually a language I have never touched, I should look at its syntax sometime; as I recall it is one of the gcc supported languages, along with fortran, C/C++, and a half-dozen or so others...

EDIT1:  Well, I looked at a couple short Ada programs and went through the beginning of this tutorial, I can say that I do not like the syntax, I prefer things like braces rather then begin/end and such, just reads better to me (not to mention, saying NewLine prints a new line makes no sense to me... how do you know it is supposed to print a new line?); however, if you know of any good design principles or anything else from the language that you like, please state.

EDIT2:  Interesting how it uses := for assignment and just = for const assignment.  I think = would be used more often though, and I do like doing const type name = something; to state that something is immutable, reads better in my opinion.  As stated though, my opinions are open to debate if sufficient evidence is shown.

EDIT3:  I have seen where ranges can be defined of in some languages, so some integer could be constrained to, for example, between, [4, 12), mean between and including 4, but not including 12, so 4 through 11 are valid numbers, problem is that hits efficiency in that it causes spurious if/then/else's to be hiddenly littered across all the code that uses it.  And although I have thought about supporting it anyway, I am still leery because of the hidden cost, since the user could put the if/then/else tests manually, and far better positioned (and usually would not be necessary anyway with a good logic structure), and if they really wanted then a class could encapsulate it and provide the same functionality (I think boost already has such a library...).

EDIT4:  And yes, I was planning to allow redefining a type and have it be distinct, was planning the D way so "alias type newtype;" is identical to how typedef in C/C++ works (new typename, but it is the same as its original type, casting is not necessary, everything) and where "typename type newtype;" actually creates a new type, so for example you could do "typename int32 Index;" and you could not cast an int32 to Index (without a cast override function at least) and so forth, they would be treated as full distinct types by the compiler.  If you cannot tell, I am taking a lot from D, since it does fix a lot of C++ issues, but it still has a few issues of its own I will need to fix.
« Last Edit: August 16, 2008, 09:57:31 AM by OvermindDL1 » Logged

BS-er
Moderator of Mayhem
Administrator
*****
Offline Offline

Posts: 2150


View Profile
« Reply #3 on: August 16, 2008, 10:39:01 AM »

Yeah there are things about Ada syntax I'm not keen on as well, but they are tolerable when you look at the positives.  Ada is not always the best for all situations, but if your job involves developing safety-critical software, you can't go wrong using Ada.  I call it the health food of programming languages.  Maybe not as tasty as some languages, but maybe healthier.  The language design is very rigid.  I have the Ada 95 spec and it leaves nearly nothing to interpretation.  It also goes higher-level than other languages, with all sorts of tasking aspects built-in and rigidly defined.  Probably not aspects you'd want to emulate directly, but at least might be inspirational in establishing a new language.
Logged
OvermindDL1
Casual Support Developers
*
Offline Offline

Gender: Male
Posts: 278

Programmer


View Profile WWW
« Reply #4 on: August 16, 2008, 01:34:16 PM »

I would be up for more security features, as long as they do not impact speed to much, or can be selectively disabled (perhaps forced on by a compiler switch I would accept, for the people who want utter security at a speed hit).

And since I had the grammar base with error handling and all the uglyness done, I decided to add more to the grammar, it now supports defining variables with a few storage class types (like static, extern, etc..., I think I have 7 or 8 so far...) of any type that is built-in or internal (I want to put type checking in the parser itself, catch errors earlier and with better reporting as to the exact error position, and this is quite easy to do with how I have this setup, except for how I have the module importing work, since modules will be linked in at compile time, I have no clue what the exposed identifiers from an external module is, so I have no choice but to accept everything for now and let it sort it out at compile time, which kills all error reporting since the compiler has no stream information by the time it gets this, especially since it might not come from a stream, do you have any ideas of how to perhaps change the module linking to handle this, I could switch to something like C/C++ headers again, but that is something I was trying to avoid, and I cannot just plain compile the other module either because there may eventually be a cyclic dependency, which would be bad for the parser, so... any ideas?).  Either way, so far, compile times for this one file have shot up from 1.3 minutes on my computer to just shy of two minutes... and still growing.  Rather interesting though, it creates an 80kb exe now, but with a new 80 meg program debug database..., think I have enough symbols so far. Tongue
Freakishly optimized though, I love these libraries, parses so fast. Smiley

Although I did more grammar and it compiled fine, I do not trust my code right now, nor am I lucid enough to test my new syntax, both due to lack of sleep for going on two days now, with as little food.  So I go hunt down sustenance then get some sleep before I test to make sure it works as it should and post up a new update on my site...
Logged

OvermindDL1
Casual Support Developers
*
Offline Offline

Gender: Male
Posts: 278

Programmer


View Profile WWW
« Reply #5 on: August 22, 2008, 03:50:06 PM »

Some updates, and I need some ideas for designing something if anyone is up for it:  http://www.overminddl1.com/forum/index.php/topic,845.new.html#new
Logged

OvermindDL1
Casual Support Developers
*
Offline Offline

Gender: Male
Posts: 278

Programmer


View Profile WWW
« Reply #6 on: September 24, 2008, 10:21:34 PM »

I need another idea for syntax, can someone read this post and see if you have any ideas?
Logged

OvermindDL1
Casual Support Developers
*
Offline Offline

Gender: Male
Posts: 278

Programmer


View Profile WWW
« Reply #7 on: September 29, 2008, 04:07:58 AM »

So, if anyone (especially non-programmers) feels up for one of my programming brain-dumps-put-to-text, could you visit this post on my forum and give me your ideas on what you think is the best way to handle this syntax issue?
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1 RC3 | SMF © 2001-2006, Lewis Media Valid XHTML 1.0! Valid CSS!


Google visited last this page May 14, 2012, 08:43:02 AM