New Language: sweet
What is this thing?
I have used quite a few programming languages over the years. Some of them I like better than others, and they each have advantages and disadvantages. If I had to rate my top 5 Languages they currently would look something like this:
- Perl, lpc, c, tcl, scheme
I read an interesting article on the web about adding visual feedback to programming, which got me to thinking hey it would be really cool to create a new language that builds on languages of the past.
I have formed some strong opinions on things I do not like about languages and I want to try and see what I can do with them. Here are some of my motivations:
- 1. Simple consistent language. Provide full functionality but keep things clean, and small. Shoot for lua vs perl. do not have multiple syntaxes for or, if statements, comments
- 2. Avoid cryptic code: sigils for variables, ? if syntax. Try to make sure code is readable and straight forward.
- 3. Look at common things and reduce the work needed: foreach instead of all the mucking about with a for statement to loop through an array. Built-in string type instead of char *.
- 4. You should be able to cut and paste the language and not mess it up.
- 5. Compiler should have a built-in pretty printer.
- 6. Compiler should have a built-in Perl critic type functionality.
- 7. Strongly typed.
- 8. Allow object oriented programming, not everything needs to be an object though.
- 9. If you look at comments I would guess that 80-90% of them are when you declare a variable or a function. If we have comments as part of the syntax of the actual language we could do cool things like hide them in the editor unless you are actually looking at that code.
- 10. Worry less about whitespace, at the same time code must be readable in a standard terminal. I think you can all agree with me that it is the job of the editor to display syntax coloring, not the code. Likewise spacing in a program should be in the domain of the editor not a detail of the code.
So far not a lot. I am starting with working on the syntax. This involves writing the documentation for the language and starting to come up with a grammar. Along with that I would like to justify why the language is doing what it is doing. I am starting with LPC as a base because I think its the closest to what I envision the final language looking like at this point.
- docs/syntax.pod A Document covering the syntax of our new language
- docs/notes.txt Things I have been thinking about
- docs/getting_started.txt A quick summary of some of the things you can do with what is here.
- src Current source code for BNFC starting with trying to build an lpc grammar and then will modify that so for now this does not line up with the docs.
- examp Example code in a couple of formats: *.c C version of a file. *.lpc LPC version of a file. *.sw SWEET(our new language) version of a file.
- lib Some basic library objects that we need These are going to be written in perl, SWEET and c These will also be used to implement our compiler in Multiple languages.
- tests The start of a test-suite for SWEET.
- critic Ideas and or simple tests that the code critic will look at.
- 1. I plan on writing the documentation describing the language.
- 2. Creating a BNF of the language.
- 3. using BNFC to create in the following order: pretty printer interpreter/debugger compiler critic/static checker package manager Documentation(perldoc) IDE?
This code is currently under the CC license, you can do whatever you want to with it. This may change in the future to something like the GPL depending on how things go.
Want to get involved? Shoot me an email, ask me questions, give me some patches or just shoot the breeze.
Kent Mein
[email protected]