Two samples from JFOS's JFS programming language

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
essial
Member
Member
Posts: 26
Joined: Sat Mar 01, 2008 10:23 pm

Two samples from JFOS's JFS programming language

Post 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.
Kevin
Member
Member
Posts: 1071
Joined: Sun Feb 01, 2009 6:11 am
Location: Germany
Contact:

Re: Two samples from JFOS's JFS programming language

Post 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.
Developer of tyndur - community OS of Lowlevel (German)
Ferrarius
Member
Member
Posts: 69
Joined: Sun Oct 28, 2007 4:10 pm

Re: Two samples from JFOS's JFS programming language

Post 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?
Modular Interface Kernel With a lot of bugs ;)
essial
Member
Member
Posts: 26
Joined: Sat Mar 01, 2008 10:23 pm

Re: Two samples from JFOS's JFS programming language

Post 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 :)
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Re: Two samples from JFOS's JFS programming language

Post 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)
essial
Member
Member
Posts: 26
Joined: Sat Mar 01, 2008 10:23 pm

Re: Two samples from JFOS's JFS programming language

Post 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.
User avatar
01000101
Member
Member
Posts: 1599
Joined: Fri Jun 22, 2007 12:47 pm
Contact:

Re: Two samples from JFOS's JFS programming language

Post by 01000101 »

heh I like it! Very impressive to see a hobby PL.
User avatar
AndrewAPrice
Member
Member
Posts: 2299
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Re: Two samples from JFOS's JFS programming language

Post 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?
My OS is Perception.
Post Reply