Hacker News new | ask | show | jobs
Spectre Programming Language (spectre-docs.pages.dev)
33 points by asdkop 31 days ago
3 comments

Is it really safe (with no UB in safe code), or just adds some safety features, but still has some loopholes allowing nasty bugs?
> You will notice the trust keyword here. Any operation (such as IO) that has an underlying unsafe mechanism (such as the @print builtin that std.stdio.print uses), must be explicitly trusted, as it is inherently impure.

just document the impure operations and stop forcing the programmer to type extra characters.

Maybe stop being lazy? The goal of the feature is to make code self documenting. It's not my problem if you're a bad programmer.
...or, you know, make something new that improves developer ergonomics. or is that too hard?
Use JavaScript instead, I really don't care about convincing you.
unfortunately I don't think you are convincing anyone
Weird reply. I'm convincing people who are capable of reading. That obviously doesnt include you.
I'm not really sure what niche this fills.

To me, the main draw looks to be the invariants that you can supply within functions, but this isn't a new concept outside of it being a dedicated keyword. Otherwise this looks like rust without all of the functionality

I'm not really sure what your point is. "Rust without all of the functionality" is sort of a ridiculous thing to say given the goals of the two projects are completely different. You can't really apply DbC in Rust, and Rust makes it difficult to iterate upon ideas due to its rigid borrow checker.
Doesn't Rust have anodized?

The usability is poor and I dislike stacking an endless quantity of function attribute markers, but if a library can replace your language, your priorities are wrong.

https://crates.io/crates/anodized

...I really don't think stacking an insane amount of attribute markers will replace any dedicated programming language aiming to solve the issue. I would rather use Eiffel than use Rust like that.
It looks like a mix between zig and rust I would say