TheBoringDev•

Have any code examples for what this language might look like?

9
GeorgeCostanza1958•

Yeah, I agree. Some examples would be nice

7
apentlanderOP•

The language is still very much a work in progress, but syntactically it looks similar to Typescript. I still haven't figured out or implemented a lot of things yet, such as generics, type aliases, opaque types, module imports, modular implicits, default args, polymorphic row args, union types, and destructuring. I plan on explore these concepts in future posts as I implement them. Here's an example of a program that is (almost) runnable, though syntax is subject to change:

// This code actually won't compile right now because I haven't implemented comments :facepalm:

// Define a module named first
First {
    // Import a foreign class from Java 
    use foreign java/io/File,

    // Define a function that takes some args. Currently struct type parameters are structural by default, though I may decide to require an explicit row variable in the future.
    gee = (fileExists: boolean, arg: { bar: int, foo: string }, otherArg: string): void -> {
        let toPrint = if (fileExists) arg.foo else otherArg
        // Everything is an expression, print returns void. I might rename void to unit to be more consistent with other languages. I also plan on removing print as a builtin very soon. 
        print toPrint
    },

    // Blocks surrounded by curly braces are just expressions that evaluate to the last expression, so they are not necessary when defining a function
    bar = (boo: string): string -> "doo",

    main = (args: string[]): void -> {
        // Let bindings are immutable. Struct literals can contain lamdas. Currently capturing vars from the outer scope doesn't work.
        let second = { baze = "something else", func = (str: string): void -> { print str } }
        let first = { foo = "hi", bar = 4 + 5, baz = 10 }
        // Foreign classes are treated as a sort of module. Constructors are bound to the name "new"
        let file = File.new("test")
        // Methods are transformed into module functions that take the object as the first arg
        let exists = File.exists(file)
        gee(exists, first, second.baze)
    }
}
7
SickMoonDoe•

This promoter understands their audience.

Examples for this obscure language were intentionally excluded to create a curiosity. If there's anything engineers are suckers for it's solving a mystery.

5
matheusrich•

I couldn't understand if the language is already in progress or just an idea. Any examples?

3
apentlanderOP•

It's a work in progress, see my reply to u/TheBoringDev

1
gilmi•

Good luck!

Have you considered other languages, such as PureScript and Gleam?

2
tobega•

Good luck! I wish you as much enjoyment as I am having with Tailspin, will be fun to see how Sasquach develops.

I didn't know the term "row polymorphism", but it seems like it's close to what I'm doing. The primitive classes look interesting as well.

Have you looked at the Truffle framework at all? It seems a promising way to implement languages on the jvm.

2
R-O-B-I-N•

Handy tip because you mentioned being fuzzy on how to verify program state. Pure functional languages are surprisingly weak here because they flatly reject any state existing which just means you have no control over stateful programs (and most programs are inherently stateful). Try linear logic. It combines well with type system logic and there's been a lot of research into using it to verify programs without needing a full model checker.

2
ttahrm•

This is really similar to what I’m working on right now!

https://github.com/MH15/imp/ https://matthall.codes/tags/imp/

I’d be very interested in getting in touch with you and sharing our progress. Based on your blog post it seems our languages have similar goals.

2
apentlanderOP•

Same here! After reading you blog it looks like we've had similar journeys. I starred your repo and bookmarked your blog. Also feel free to reach out to me at the email linked in the post.

1
crassest-Crassius•

Cutting edge of the JVM - The language should work on new JVM versions as they are released. It should take advantage of the latest features to ensure that the language is using everything that the JVM has to offer. I plan to make structs primitive classes and for concurrency to be built with Project Loom in mind.

Sorry, but I had a chuckle there. Cutting-edge, on the JVM? At this point I seriously doubt that Project Valhalla or Project Loom will ever even release. It feels like they're dead in their tracks. And with type erasure never getting corrected, the JVM looks to be ever the more archaic competitor. I think targeting the CLR, where these "cutting-edge features" are long-established, would be better. And if you're targeting the JVM, that's OK, but it's credulous to expect any evolution from that slow-mo mastodon.

1

Precision F-Strike. Credit is to TV Tropes. Notice the existence of exactly one f*** in the entire article.

-7