Once upon a time, I was writing programs for the HP Prime in HPPL. The more I worked in HPPL, the more I became dissatisfied with the language. I mean, it was usable, but I wanted better.

So I decided to make something better. I started work on Source. It's a programming language.

Source is a procedural, statically-typed bytecode-compiled language that can either compile to whatever platform you need or interpret directly on your computer. Currently, it compiles to HPPL.

Source gives you control. It's statically typed, so you can read your code more easily. It can assume types, so it's not needlessly verbose. You can control how it compiles through directives.

Source is flexible. It provides data structures and user types. You can define methods for data types anywhere. You can organise your code into packages. Source even can handle cyclic dependencies!

Source has tools. Compile it into HPPL from the command line, or use SourceBench to write and compile code on the fly. Use SourceBox to run your code on your PC. Run SourceLine to interactively execute Source code.

Source isn't done yet. The core libraries still need implemented, not to mention a bunch of features such as custom structs and classes. In the future, it will be able to compile to a bunch of places, not just HPPL. I wouldn't describe it as 'usable' yet. But stay tuned!

Anyways, the important bit: The link. Check out the source code at:

https://github.com/iconmaster5326/Source

Want to download Source? Want to learn more? Check out the wiki at:

https://github.com/iconmaster5326/Source/wiki

The wiki has downloads, documentation, and tutorials.
This is really cool work, iconmaster. Did you have a background with programming languages (ie, PL, not programming in general) when you started this, or did you pick up what you needed to know as you went along? Did you base your design choices on any particular language(s), or do you think the features of Source are relatively unique? I didn't look at your repo yet; how platform-dependent is it? Do you see a future where Source might be used to compile programs for the HP Prime (HPPL) and TI calculators (Lua/ASM/BASIC/something else) from the same code? I can't wait to hear more about this, although I gather that life is busy and progress may be slow.
KermMartian wrote:
This is really cool work, iconmaster.


Thanks a bunch!

KermMartian wrote:
Did you have a background with programming languages (ie, PL, not programming in general) when you started this, or did you pick up what you needed to know as you went along?


I haven't been in a PL class yet; it's still a year or two away, prerequisite-wise. I picked up what to do along the way! It's been quite the journey.

KermMartian wrote:
Did you base your design choices on any particular language(s), or do you think the features of Source are relatively unique?


It's mostly inspired by Java and C, but it has a lot of features I came up with. Type functions, for instance, were my idea, as well as the iterator system. Of course, they probably are not unique... But you understand.

Basically, I wanted the language to be either like Java, but with less boilerplate, or like C, but with more quality-of-life features.

KermMartian wrote:
I didn't look at your repo yet; how platform-dependent is it?


the Source compiler is written in Java, so it's as platform-independent as Java is. I thought about doing it in C, but that never happened...

KermMartian wrote:
Do you see a future where Source might be used to compile programs for the HP Prime (HPPL) and TI calculators (Lua/ASM/BASIC/something else) from the same code?


That is Source's ultimate goal, I'd say. Of course, the libraries for the different platforms will be different, but I will make the standard libraries cross-platform.

KermMartian wrote:
I can't wait to hear more about this, although I gather that life is busy and progress may be slow.


College is taking up a lot of time, that's true. I appreciate your understanding of my limited time...

I'll be sure to keep you posted!
Hey, a quick question for all you people here:

I'm finalizing pointer operations in Source. What syntax looks better to you guys?

one() is a function that returns a pointer to a local. two() returns the value inside that pointer, dereferencing it.


Code:

//idea 1
function one() as ptr[int] {
   local a = 2
   return a.ptr
}

function two(b as ptr[int]) as int {
   return b.value
}



Code:

//idea 2
function one() as $[int] {
   local a = 2
   return $a
}

function two(b as $[int]) as int {
   return b$
}
I think number two looks better.
The idea 1 version looks very explicit, in the sense that I, with no knowledge of the language, was able to quickly understand what "a.ptr" and "b.value" meant, and even if I didn't know what pointers are, it would be easier for me to recall the meaning of such syntax whenever I saw it.
Idea 2 gives absolutely no hints as to what $a and b$ mean: without previous understanding of the language, I have no idea that the $ is related to pointers, and I can imagine myself struggling to remember if having the $ after dereferences the pointer, or if it's the other way around. It has the advantage of being much more compact / less verbose than the first idea (and in that sense, it may look better, yes). Idea 2 presents problems and advantages similar to those of the * and & in C, so the question is: do you want to follow the steps of C, or not? (is the language meant to err on the "easy to use, verbose" side, or on the "hard to master, concise" side?).
I agree; option 1 is a little clearer, but it is all a matter of how concise you wish to make things. Vey cool work on this, by the way! Smile
I think I'll go with option 1. Thanks for the input.

Anyways, I've made a big decision. I'm rewriting Source from scratch. It'll eventually make it a lot better (eventually). I'm also thinking about renaming the language; a lot of people have pointed out how bad the name is. Any suggestions?

Anyways, the drone.io still has the old Source versions up, so feel free to still look at it. Thanks!
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement