ExC: Custom programming language

Programming, for all ages and all languages.
User avatar
Elttob
Member
Member
Posts: 28
Joined: Mon Sep 12, 2016 10:21 am
Location: London, UK
Contact:

Re: ExC: Custom programming language

Post by Elttob »

Small update; working on creating an AST from a queue of tokens. Each AST component has a parent (except for root) and children, creating a hierachial tree. AST components can also have metadata (this is currently used in functions to store name, return type and access level)

Image
I'm bored.
User avatar
dchapiesky
Member
Member
Posts: 204
Joined: Sun Dec 25, 2016 1:54 am
Libera.chat IRC: dchapiesky

Re: ExC: Custom programming language

Post by dchapiesky »

You may wish to look at this...

http://www.antlr.org/

cheers
Plagiarize. Plagiarize. Let not one line escape thine eyes...
User avatar
Elttob
Member
Member
Posts: 28
Joined: Mon Sep 12, 2016 10:21 am
Location: London, UK
Contact:

Re: ExC: Custom programming language

Post by Elttob »

Thanks for providing the link, but I'd rather make the parser and such manually, since I don't want to miss out on the experience that I could probably use in the future :p
I'm bored.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: ExC: Custom programming language

Post by Solar »

Actually, the experience you probably could use in the future would be using parser generators. Bison, ANTLR, Boost.Spirit. If you're writing your own parser, for your own programming language, for your own OS, you're looking at tripple reinvention of the wheel.

Next thing you'll design your own language for programming your own parser for your own different language... and then design your own text editor for programming.... it has to stop at some point. ;-)
Every good solution is obvious once you've found it.
User avatar
Elttob
Member
Member
Posts: 28
Joined: Mon Sep 12, 2016 10:21 am
Location: London, UK
Contact:

Re: ExC: Custom programming language

Post by Elttob »

Solar wrote:Actually, the experience you probably could use in the future would be using parser generators. Bison, ANTLR, Boost.Spirit. If you're writing your own parser, for your own programming language, for your own OS, you're looking at tripple reinvention of the wheel.

Next thing you'll design your own language for programming your own parser for your own different language... and then design your own text editor for programming.... it has to stop at some point. ;-)
Yeah lol. I'll probably stop at OS though :p
Reinventing the wheel is kinda fun tho
I'm bored.
User avatar
Octacone
Member
Member
Posts: 1138
Joined: Fri Aug 07, 2015 6:13 am

Re: ExC: Custom programming language

Post by Octacone »

Can I create classes and access functions and objects using the dot operator? Does it support operation overloading? Can you use voids (any other function types) with structs? Is there a way to test this language out? Also I really really like its name. Keep working no matter what people say. Sometimes you do stuff because you want to learn something / have fun. My personal opinion is that you should make it more like C# and less like C++. This should be a combo of C and C#.
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
User avatar
Elttob
Member
Member
Posts: 28
Joined: Mon Sep 12, 2016 10:21 am
Location: London, UK
Contact:

Re: ExC: Custom programming language

Post by Elttob »

octacone wrote:Can I create classes and access functions and objects using the dot operator? Does it support operation overloading? Can you use voids (any other function types) with structs? Is there a way to test this language out? Also I really really like its name. Keep working no matter what people say. Sometimes you do stuff because you want to learn something / have fun. My personal opinion is that you should make it more like C# and less like C++. This should be a combo of C and C#.
ExC doesn't support classes atm, and pointers are still a big work in progress, so I can't say much there except I do want pointers to be able to point to anything, and to have a fairly legible syntax (originally I was going to do something like "int pointer var = 5;" but then how would it handle pointers to pointers and such). I am working on a way to test the language; the compiler will spit out an assembly-like bytecode which you'll be able to put either into a second compiler (to turn into assembly) or VM (VM is what I've decided to do first since it's more platform independent and I can use it to start testing the language's syntax for real).
I'm bored.
Post Reply