Page 1 of 1

some fellow programmer's suggestions plz :)

Posted: Wed Jun 10, 2009 11:16 pm
by flyingdoodltartz
Hey osdev.org peoplez, i decided that im going to be writing my 4th programming language, and this one will be a compiler (my second compiler, the other two i wrote were interpreted languages). Just like the others, their syntax will be of my own design, and yours too! i want you guys to give me some ideas on features that you think would be cool in a language. So far, i have the following stuffs from suggestions from some friends:

functions:

function funcname(args)
code
endfunction

structures (just like in c++ guys ;))

structure mystruct
some variables
some functions
blah blah blah
endstructure

loops:

loop (break to break the loop)
code
endloop

conditions:

if condition do
code
endif

variables:

byte myvariable = blah

pointers:

byte pointer = ->myvariable (make pointer point to myvariable)
pointer-> = blah (set value that pointer points to)

pointer = ->funcname(args)
pointer->(args) (execute function pointer points to)

strings:

byte[12] hello = "hello world" + 0x00

other stuff:

jump blah (jump to a location in the memory)
push(value)
pop(destinationvariable)
syssetreg(reg, value) (set the value of a register)
sysint(interrupt) (call an interrupt)

plz tell me what you think and how the syntax can be improved/changed. i am trying to make a language capable of very low level things and still keep the ability to achieve high level syntax. any and all suggestions are welcome :D.

regards

teddy

Re: some fellow programmer's suggestions plz :)

Posted: Wed Jun 10, 2009 11:36 pm
by whowhatwhere
Implement lambda abstraction.
???
Profit.

Re: some fellow programmer's suggestions plz :)

Posted: Thu Jun 11, 2009 12:26 am
by flyingdoodltartz
oo yes, that is a great idea :D. I will do that :).

Re: some fellow programmer's suggestions plz :)

Posted: Thu Jun 11, 2009 12:45 am
by Combuster

Re: some fellow programmer's suggestions plz :)

Posted: Thu Jun 11, 2009 2:27 am
by flyingdoodltartz
oo, thanks, reading through those threads right now :).

Re: some fellow programmer's suggestions plz :)

Posted: Thu Jun 11, 2009 9:40 am
by earlz
it's bad looking. About like BASIC for system programming.

I doubt it'll get very far and in a few weeks you'll be thinking what a cumbersome language this is, and be using C instead

Re: some fellow programmer's suggestions plz :)

Posted: Thu Jun 11, 2009 10:23 am
by Combuster
in a few weeks you'll be thinking what a cumbersome language this is
Says the one who hasn't seriously programmed it and is speaking out of prejudice.

No language bashing please.

Re: some fellow programmer's suggestions plz :)

Posted: Thu Jun 11, 2009 1:15 pm
by steveklabnik
Combuster wrote:
in a few weeks you'll be thinking what a cumbersome language this is
Says the one who hasn't seriously programmed it and is speaking out of prejudice.

No language bashing please.
However, this language offers NOTHING over something like C. It's just C with 'endwhatever' instead of '{' and '->' instead of '*'.

It's not even worth the time it would take to implement.

I agree with you, language bashing for the sake of language bashing is silly, however, this 'language' will just be a waste of time. Not that there's anything wrong with wastes of time, mind you. But the OP should be aware that that's what this is. If he wants to waste his time, more power to him.

Re: some fellow programmer's suggestions plz :)

Posted: Thu Jun 11, 2009 2:51 pm
by flyingdoodltartz
well, that's why im here, for you guys to tell me how i may improve it. I don't mind if he bashes it and says it sux, that just means i have to go back to the drawing board ;). and that's no problem with me :D. back to the drawing board it is.

Re: some fellow programmer's suggestions plz :)

Posted: Thu Jun 11, 2009 3:31 pm
by steveklabnik
flyingdoodltartz wrote:well, that's why im here, for you guys to tell me how i may improve it. I don't mind if he bashes it and says it sux, that just means i have to go back to the drawing board ;). and that's no problem with me :D. back to the drawing board it is.
I love compilers. Its one of the things that I find really interesting about Computer Science in general. So please don't take my words as being discouraging.

There's nothing wrong with doing something to learn about it. Yes, there are a ton of C compilers out there, but if you've never written one before, writing yet another C compiler is probably the best way to learn about the subject. So if this is your reason for doing so...write another C compiler!

However, if you want to write a new language that'll help people do systems programming more easy, then you need to come up with language features that are helpful to people writing systems. It's not as simple as changing some syntax... find something that's hard to do, and try to make it easier.

That's a pretty tall order, though. Good luck!

Re: some fellow programmer's suggestions plz :)

Posted: Thu Jun 11, 2009 3:59 pm
by flyingdoodltartz
lol thanks. This is actually the second compiler i've written. The other one was the learning one ;) (super super useless language). So i guess i will take your advice and wait until i run into a bunch of problems that could be made easier. The actual goal of my language was to create a language capable of achieving low level implementations, but still maintain the ability to do high level stuffs. I think ill go look at more languages as a model and think of more stuff that can be done.

thanks for your feedback

teddy