What you expected sounds more like what nim offers.
christophski@feddit.uk 11 months ago
Literally the opposite of friendly. Already in the hello world you have two imports for extremely basic functionality (why should I have to import the ability to throw exceptions??) and a completely enigmatic symbol ’ that apparently has a significant function.
A “friendly” programming language should be readable without knowing esoteric symbols.
daylin@lemmy.dayl.in 11 months ago
zarlin@lemmy.world 11 months ago
python-level intuitive-to-read language with static typing
Agreed, this is exactly Nim
christophski@feddit.uk 11 months ago
Thanks I’ll check it out
steersman2484@sh.itjust.works 11 months ago
There are no imports, these are type annotations
christophski@feddit.uk 11 months ago
Do I really have to declare that something requires exceptions?
steersman2484@sh.itjust.works 11 months ago
Yes, in functional programming you want to use pure functions. Exceptions are impure, therefore it has to be declared.
Other functional languages don’t even have exceptions
robinm@programming.dev 11 months ago
I’m surprised about this statement, I would have said that exceptions are the consequence of an impure operation (that may or may not fail differently every time you call it).
sloppy_diffuser@sh.itjust.works 11 months ago
That’s one of the things I appreciate in a language/framework. Drives me nuts getting an exception from a dependency of a dependency of a dependency.
Even better if its baked into the type system and I can’t run my code without handling it.
Pipoca@lemmy.world 11 months ago
Functional languages typically have type inference.
It’s less that you have to declare something can do IO or throw an exception, and more that you’re calling something from the standard library that does IO or throws an exception.
Most stuff does neither. There’s a type level distinction between normal, regular pure code, and impure effectful code, so it’s easy to tell from the type signature whether a function is pure or not.