HNHacker News
TopNewBestAskShowJobs

adamthekiwi99

60 karma · joined July 31, 2020

Programmer, musician, student at UTK.

adam-mcdaniel.net

submissionscomments
adamthekiwi99··on Show HN: The Sage Programming Language
That's right! I think it's a good balance between giving the typechecker the info it needs, but also being flexible in how you can supply it!
adamthekiwi99··on Show HN: The Sage Programming Language
Hello, thanks for the great question! Yes, you do have to specify where a variant comes from, but it doesn't have to be nominal at all! Here's an example:

``` enum Option<T> {Some(T), Nothing}

// Create a value with an inline type that doesn't use the nominal `Option`

let opt1 = enum {Some(Int), Nothing} of Some(5);

// Define a second option value, which is assigned with the first

let opt2: Option<Int> = opt1;

// Print the result

println(opt2); ```

You can create a variant of an inline `enum` type, and then typecheck it against another structurally equal type if you so choose!

I hope this example properly illustrates how powerful the structural type-checking is with enums!

adamthekiwi99··on Show HN: The Sage Programming Language
I'll have to check it out and reimplement it's good features for THIS Sage hahaha
adamthekiwi99··on Show HN: The Sage Programming Language
How long until we enumerate all the herbs?!?!?!?!?! The pantry's almost empty!!!
adamthekiwi99··on Show HN: The Sage Programming Language
My major constraint is just that the name must lend itself well to artistic representations and fun mottos/slogans hahaha!

I love these suggestions, especially Moss and Ivy! Thank you!

adamthekiwi99··on Show HN: The Sage Programming Language
Hahaha I doubt there's an English word left!!!
adamthekiwi99··on Show HN: The Sage Programming Language
Thanks for the great question, and for checking out the project! This project started out because I noticed some really interesting properties about compiling brainfuck-like programming languages while writing high level language compilers that targeted these brainfuck-like backends.

This is the work that inspired Sage: Harbor (https://github.com/adam-mcdaniel/harbor). My goal with Sage was to take everything that makes a brainfuck-like programming language easy to compile, while also keeping all the time complexity and optimizations of regular algorithms. So, in that sense, it started out as an attempt to design around a Turing machine -- I wanted this to be a dialect of brainfuck. The VM doesn't use any stack operations, just operations on a tape pointer + an accumulator!

adamthekiwi99··on Show HN: The Sage Programming Language
I like it! And if that's trademarked too I could always fall back on "spearmint" instead haha
adamthekiwi99··on Show HN: The Sage Programming Language
Thanks so much! I originally added it to experiment with the structural typing -- the type system is a really cool foundation for some awesome future stuff!

Thanks for checking out the project, I'm glad I was able to surprise you haha! :)

adamthekiwi99··on Show HN: The Sage Programming Language
Thank you!! Sage will eventually change its name (I just recently found out about this), but I haven't had time to come up with a good replacement name and make art + quippy sayings for it yet! :)

I might just go with a completely made up word to avoid any trademarks entirely haha

adamthekiwi99··on Show HN: The Sage Programming Language
Hello, yes, I'll go back and add some text examples as well. (I didn't like how GitHub does syntax highlighting though :/)

I put all the example programs in text on the web-demo, though, if you want to see more there! You can copy, read, or modify them there!

https://adam-mcdaniel.net/sage

It's different from Rust in that it has structural typing and a more Python-like experience! Types are constants, and can be printed with `print` like other values

Thanks for your input! I hope you like the project!

adamthekiwi99··on Show HN: The Sage Programming Language
Right now, memory is managed like C or C++, but I intend to implement lifetimes in the frontend eventually.

But definitely no garbage collection (although, a target could implement it against the standard and it would work)

Thanks for checking out the project!