5 ms·
I hope its a big update with static types
by threeaccents 4y ago
I hope its a big update with static types
- codesnik 4y agoI've seen his comment somewhere (on reddit?), it's not.
- zach_garwood 4y agoThat would be neat! I would really like it if added optional typing like Python or PHP.
- tiffanyh 4y agoI thought Erlang lacked a type system. How would this work since Elixir compiles into BEAM byte code (via Erlang Abstract Format)?
- Lio 4y agoDo you need to have static typing in your byte code for static typing at the language level to be useful? I ask because the JVM lacks static typing[1] at byte code level but Java and Scala have it at the language level where it seems to be useful for correctness and performance. 1. https://wuciawe.github.io/jvm/2017/03/04/notes-on-jvm-bytecode.html https://wuciawe.github.io/jvm/2017/03/04/notes-on-jvm-byteco...
- andy_ppp 4y agoSure but so does javascript, it doesn’t mean it can’t be added at compile time and add a lot of value.
- jjtheblunt 4y agothe compiler can type check source code for any obvious insanities, and thereby catch and prevent, at compile time, a subset of what would be runtime errors. that's the idea anyway. (i worked on v8 for example, and other compilers, and typescript does something similar targeting javascript)
- suprfnk 4y agoI thought so too, but Jose Valim says "never before seen on Elixir or the BEAM", while Gleam exists and Jose undoubtedly knows about that project: https://gleam.run/ https://gleam.run/
- throwawaymaths 4y agoAlso meta has a static typing system for Erlang. Also, dialyzer exists. So if it's "never" he means set theoreic types, but there are incomplete set theoretic type libraries for elixir
- fud101 4y agoBy meta do you Facebook? If so just say that, it's confusing otherwise.
- true_religion 4y agoMeta is also WhatsApp, which is what I know was part of the erlang community.
- jaquer_1 4y ago
- throwawaymaths 4y agoI had actually started typing Facebook, then remembered that it was Whatsapp, which post name change is technically not Facebook but actually meta, so I submitted as meta for correctness
- sph 4y agoIIRC José recently said he was was gonna spend some time thinking about Elixir's approach to typing, so that's probably it. My hope is a smaller runtime that works well for CLI tools. I'd love to use Elixir for small scripts I'd ordinarily use Go/Python for.
- hinkley 4y agoI had an idea years ago when I still had the young man’s dream about writing a programming language. It came after I took over a J2ME project that was trying to do a great deal of functionality in an 85K jarfile. That idea was that there should be a little language inside of each big language that is used to implement the self hosting aspects of the language, and then a small set of additional libraries would provide a usable embedded variant of the ecosystem, good for small places and things that have to start quickly.
- packetlost 4y agoI like this idea. I believe Rust does something somewhat similar (though not quite) for processing compile-time procedural macros. We see somewhat similar, but external approaches in the Clojure ecosystem with Babashka and Joker (and probably a few others). In general, I like this, but not every language actually needs it. Like, what would that even be in Python for example?
- hinkley 4y agoSomething for PyPy perhaps? JITs written in the host language are the original use case I was thinking of, but that’s not the sole domain where it applies.
- andy_ppp 4y agoYes, but there’s a PhD student working with Jose on this and I think the timeline was 18 months. My guess is it’s a joke around how stable everything in the Elixir world remains compared to other constantly evolving ecosystems.
- vasergen 4y agostatic types is the main thing that keeps me from putting more time into learning / using elixir.
- Milner08 4y agoSame. I would love to see it get static types.
- epolanski 4y agoMe too. Every time I read statements like this from Jose "This brings another discussion point: a type system naturally restricts the amount of code we can write because, in order to prove certain properties about our code, certain styles have to be rejected." I can't but think few things: - by compilers (in this case static type checkers) laws we all know that there are valid programs that won't satisfy the type checker and viceversa there's only a handful (none being production or development ready) of compilers powerful enough to infer all code bugs - limiting the expressiveness of a language isn't necessarily a bad thing I've noticed that people with a huge background in dynamic languages tend to have a natural refusal for static types. Lispers are a community with such an attitude, even the typed lisps like typed/racket seem to be born more to please people wanting typecheckers and academics than the userbase itself. But I, and my mind, work the other way around: I want to think about the types first, I need them to express my domain and my DSLs, so I need an expressive type system able to translate my thoughts and validate all of my program with nothing but types. It's possible in plenty of languages (most famous one is TypeScript with its declare keyword) to do type-driven development and I can't really function without it. Once a program has been well modeled, once I've seen the APIs, then and only then I get into implementation and it is by far the part I spend less time on. Every time I read a lisp dialect without static types (most of them) my mind just doesn't work properly, I can't follow much. And I really believe that the lack of commercial success for many of these languages derives from how poorly non statically-typed languages scale when klocs and number of maintainers of a project start increasing.
- bcrosby95 4y ago> I've noticed that people with a huge background in dynamic languages tend to have a natural refusal for static types. Lispers are a community with such an attitude, even the typed lisps like typed/racket seem to be born more to please people wanting typecheckers and academics than the userbase itself. I feel like it's the opposite. It seems like we have this huge wave of a push for static types. The only way I can explain it to myself is that a bunch of people using dynamically typed languages finally came over to the static typing side. And I say this as someone that worked using statically typed languages for pretty much all of their career. I get it for TypeScript and the frontend. The frontend is a huge, complex mess of interactions, in the same codebase. Static types are awesome there. But the way we write most backend systems these days, IMHO, static types are practically a nothingburger. Sure, they were awesome when I was working on those millions of LOC projects back in the 2000s. But nowadays those millions of locs are spread across N projects which are separated by a typeless network boundary so I'm not looking at anything more than 50-100k LOC anyways. So I just don't get it. Systems are written in a way that devalues static typing, but it feels like the demand for it is higher than ever.