Hacker News new | past | comments | ask | show | jobs | submit login
The Styx Programming Language (gitlab.com/styx-lang)
38 points by sixthDot on July 7, 2023 | hide | past | favorite | 26 comments



I think it would be great to include a short, simple example on the landing page — perhaps after the introduction but before the build instructions. That's the sort of thing that piques my interest and makes me dig deeper.


Judging by the name I was expecting this to be an esolang.


I was expecting it to be related to Bell Labs' Inferno: https://en.m.wikipedia.org/wiki/Inferno_(operating_system)


Neat! I like the syntax from what I've read so far.

I'm aware of Rust and Zig and Nim and wish I had more time to try these out and see what's going on.

Alternatives to C/C++, especially in the embedded systems space, have some real potential.


It's written in D, cool! Would love to know why.


D is one of those languages that goes quietly under-celebrated while simultaneously being very useful. Always a pleasure seeing it pop up on HN.


What makes D stand out?


Some other languages implemented in D:

- Vox: https://github.com/MrSmith33/vox

- Neat: https://neat-lang.github.io/

- Volt: http://www.volt-lang.org/


Formely yes but self-hosted since 18 months.


Kind of disappointing that this seems to be yet another run-of-the-mill language.

I wish people would stop publishing me-too languages that implement, for the umpteenth time, the same concepts we have had for 40 years or more. I mean, if you just to learn from the experience of creating a language, that's fine, but you probably won't get much from publishing it.

If one intends to publish a language, it seems to me one should focus on crafting a language that explores something new. That new concepts do not have to be very refined or complex, but your language stand a much better chance of being picked up and refined if it implements the germ of some interesting new idea.

Of the top of my head, here are some concepts [1] I'm trying to explore (cross posted from another comment of mine), which might provide inspiration for others:

- Dependent types, with no real distinction between values and types (At a certain point, Typescript’s type system begins to look like a separate Turing-complete language within a language. It’s probably time to do away with this dichotomy entirely somehow)

- JSX built-in without the need for any React-like dependency (No need to use it if you don’t like it; in the general sense, it’s just syntactic sugar for composing function invocations)

- Localizable or customizable keywords/operators, with automatic translation provided by an utility or language server (Why should programming languages be tools of cultural hegemony?)

- Generic object literals (Why should generic type inference be limited to functions?)

- Deep support for an alternative to exceptions using a Failable<TResult, TError> type

1. They may not be totally new concepts (as in some non-mainstream languages might implement them to some extent), but they are sufficiently of the beaten track that they are a rich source for exploring all kinds of interesting features.


It depends on the creator of the language which itch the language is supposed to scratch. For example, all of your above points just make me yawn.

To arrive at some more objective criterium, I would strenghten your idea of "exploring something new" as follows: How does the language make something new possible, that wasn't possible before? Built-in JSX doesn't survive this test, for example, because JSX was certainly possible before.


I see. So what are some features that would satisfy the criterium that you would like to see in languages?


I would like to have a programming language that also works as a logic, and doesn't use types to achieve that. Think equational reasoning, but with binders.


I think you are putting far more weight on "publishing" (=throwing it in public code hosting) something than most people. I imagine for many having their pet projects in the public is the default option rather than some explicit decision or action.


Why shouldnt they publish it? not everyone wants to invent something new as just learn what already exists.

The first paragraph of the project literally say

> Styx is a hobby project that had initially no other goal than to experiment self-hosting of a compiler

Its a hobby.


I think gp is just conflating publishing on the internet with being posted on HN.


> I wish people would stop publishing me-too languages that implement, for the umpteenth time, the same concepts we have had for 40 years or more. I mean, if you just to learn from the experience of creating a language, that's fine, but you probably won't get much from publishing it

It's not really a language designed to be used. I've decided to post the link today to see a bit what people think.

> - Generic object literals (Why should generic type inference be limited to functions?)

Good idea.


I basically want Rust without the focus on memory safety.

As a business programmer, I don't want to think about whether something is stack or heap allocated. I just want explicit clones, immutability by default, the ecoysystem, the toolchain and dang I want sum types.


Besides OCaml, Standard ML, Scala Native, F# (with Native AOT).


Take a look at OCaml, Kotlin, and F#. They aren't literally what you described, but they're close enough than I think you may find them useful.


Modulo eco-system, it's called Ocaml. And maybe the eco-system will still happen.


This isn’t about you, or for you.


My experience is different. When I looked at Styx for the first time, it was like a gathering of angels appeared above my head. Of course it turned out they were aliens, but that's beside the point.


I would be interested if you could develop the problems you've seen


Every year there are thousands of programming languages published around the globe from university students taking compiler and language design courses.


> Localizable or customizable keywords/operators.

See lamdu IDE.

> Deep support for an alternative to exceptions using a Failable<TResult, TError> type

See Zig's solution.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: