Page 1 of 1

Two samples from JFOS's JFS programming language

Posted: Sun May 31, 2009 11:33 pm
by essial
Both are console style applications. The syntax is a mix of xml, python, and a few others. I put the code in pastebin due to the fact that pastebin actually does syntax highlighting :)

Hello World:
http://pastebin.com/m3470341e

Adder program (accepts 1-2 params and returns the results of adding the two together):
http://pastebin.com/m4696f30e

I don't plan on making any major changes to the system as my compiler can already generate the bytecode files from these sample sources, but as before, if anyone has any comments or wisdom I'd love to hear it!

Obviously if I got far enough, there would be an IDE that can hide most of the XML stuff, but for now everything is hand crafted.

Re: Two samples from JFOS's JFS programming language

Posted: Mon Jun 01, 2009 3:04 am
by Kevin
Looks... er... interesting. ;)

I guess Console, App or args are some kind of objects? How would I declare my own objects? What about functions and loops? Defining structured data types. including arrays? Can you split a program into multiple modules? Will the language support pointers or some kind of references? I could go on like this for a while, your example doesn't really show that much of what a real language needs.

Anyhow, writing programs in such an XML based language is going to be a tedious task, I suspect. And for writing programs you really shouldn't need more than a simple text editor.

I don't want to sound too negative. You seem to have a clean (I hope) parser for your simple test program, so you have already achieved a lot. But you really should keep in mind what you need to add (and your design will need to fit) until it is a usable language.

Re: Two samples from JFOS's JFS programming language

Posted: Mon Jun 01, 2009 4:27 am
by Ferrarius
It's really nice to see another person's programming language. I personally wouldn't use an XML based language but I guess that has to do with preferences and what people are most proficient in. Still, is there already some kind of documentation available?

Re: Two samples from JFOS's JFS programming language

Posted: Mon Jun 01, 2009 8:58 am
by essial
Kevin wrote:I guess Console, App or args are some kind of objects? How would I declare my own objects? What about functions and loops? Defining structured data types. including arrays? Can you split a program into multiple modules? Will the language support pointers or some kind of references? I could go on like this for a while, your example doesn't really show that much of what a real language needs.
You are very correct, I am putting up a website within the next few months that will include an entire manual for JFS. Don't worry, it's all specced out and you can do all of the mentioned things. I knew there would be some confusion but I didn't want to throw too complicated of an example out there just yet, I wanted to show something I can actually compile and run right now :)
Kevin wrote:Anyhow, writing programs in such an XML based language is going to be a tedious task, I suspect. And for writing programs you really shouldn't need more than a simple text editor.
You are also right about that. It is a bit tedious. If my OS and/or scripting language is ever used by more than 5 people then mayhaps some of those people wouldn't mind helping develop an IDE around the laguage. At that point, the XML "disappears" and everything is nice and easy.
Kevin wrote:I don't want to sound too negative. You seem to have a clean (I hope) parser for your simple test program, so you have already achieved a lot. But you really should keep in mind what you need to add (and your design will need to fit) until it is a usable language.
Negative is fine. In fact, the more the better, it's the best way to improve. The language compliments the underlying OS and its unique(ish) design ideals. There is also already a working virtual machine (think java, not vmware) that can run these apps in linux (and could in windows if I were half arsed to write the support for that) just as they would in JFOS.

I may post some of the actual specs today. Right now, most of it is written in a composite notebook (just about filled the damn thing up), so I have to transcribe it all into something more human readable :)

Re: Two samples from JFOS's JFS programming language

Posted: Mon Jun 01, 2009 9:35 am
by earlz
That seems so annoying to use.. and even to read..

Way too verbose for me to write code in. (though you can skim over it and tell what it does)

Re: Two samples from JFOS's JFS programming language

Posted: Mon Jun 01, 2009 9:40 am
by essial
earlz wrote:That seems so annoying to use.. and even to read..

Way too verbose for me to write code in. (though you can skim over it and tell what it does)
Yeah, as I said, the XML part will be hidden when/if an IDE ever materializes. But it's necessary for the way the subsystem works.

Re: Two samples from JFOS's JFS programming language

Posted: Mon Jun 01, 2009 12:10 pm
by 01000101
heh I like it! Very impressive to see a hobby PL.

Re: Two samples from JFOS's JFS programming language

Posted: Sun Aug 09, 2009 6:35 pm
by AndrewAPrice
@OP: I was curious to see what your language was like, but Pastebin was expired your post. Do you mind pasting the code in a post?