Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
josevalim
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
61.
▲
by
josevalim
2y ago
While it is a bit unfortunate that the time spent to write the article continues to be used as a criticism, and perhaps as a dig, I’ll only add that I have no formal background on type theory or logic. So much of the 15 months was also spen
62.
▲
by
josevalim
2y ago
> This kind of breaks my mental model of major version bumps. If you want, you can reset the revisions in a major version, as you could rename all modules and change the behavior of all functions, but that's hardly a good idea. Revi
63.
▲
by
josevalim
2y ago
> This compounds when a library releases a new breaking major version, presumably - `%SomeStruct{}` for v2 may be different from `%SomeStruct{}` v1r2. You should never reuse the revisions. If you launch a major version, then it means you
64.
▲
by
josevalim
2y ago
Thank you for the comments. Your questions at the end resonate a lot with what I have been asking myself! > Structural sub-typing with inference Can we have structural sub-typing with inference that is relatively fast and will generate r
65.
▲
by
josevalim
2y ago
The work to develop the base theory, which this article presents, takes 15 months, but it doesn't take 15 months to read it (and hopefully it won't take as long to use it either). Whenever you use a programming language, you may w
66.
▲
by
josevalim
2y ago
Author here. This is probably the article that took me the longest to write, roughly 15 months, and I may still not have explained all concepts with the clarity they deserve and I intended to. If there is any feedback or questions, I'd
67.
▲
Data evolution with set-theoretic types
(dashbit.co)
127 points
by
josevalim
2y ago
|
32 comments
68.
▲
by
josevalim
2y ago
Yes, it all goes through the same pipe, but we enter the pipe through different places, which leads to different outcomes. You get different limitations and results depending if your input is Erlang source (Gleam), Erlang AST (Elixir), or C
69.
▲
by
josevalim
2y ago
Transpilation usually refers to the fact the target of your compiler is another language source code, which then has to be parsed again. Which leads to issues such as mismatched lines in stacktraces at runtime. Elixir and LFE use the same c
70.
▲
by
josevalim
2y ago
Although if you want to get into Erlang/BEAM and static types are a requirement, I still strongly recommend checking it out. :)
71.
▲
by
josevalim
2y ago
You are right. There are many positive things about TechEmpower and keeping it open to all and running takes an incredible amount of effort, which is definitely appreciated and I failed to recognize. That was unfair of me. Although I still
72.
▲
by
josevalim
2y ago
There are several domains where 0 is different from none, for example, most computations involving rates. Imagine that you are running some A/B tests and you want to track conversions. If one of the experiments received 10 users and ha
73.
▲
by
josevalim
2y ago
I know you are quoting the docs, but Gleam absolutely throws implicit exceptions, for exactly the same reason why it returns 0 when dividing: the Erlang/VM does not support Infinity/NaN, which means floating point operations can a
74.
▲
by
josevalim
2y ago
Yes, unfortunately transpilation comes with real downsides. Up until recently, logger events, error messages and stacktraces were displayed in Erlang formatting. It has improved in few cases, but not all, and the line numbers in stacktraces
75.
▲
by
josevalim
2y ago
YMMV. In benchmarks like cached queries, it already outputs a solid 5.5x faster than Rails, and it is worth remembering that the Rails app is way too stripped compared to what folks are actually running in prod (which was one of my original
76.
▲
by
josevalim
2y ago
Understandable! The documentation provides quite more guidance now (and there is nothing wrong with naming your context after your "models").
77.
▲
by
josevalim
2y ago
> The database pool needs to be at 512 to 1024? Yet Rails seems to get away with far less than that and still have better performance.[2] Rails concurrency model is per process . So you will have `n_workers` pools and the amount of conn
78.
▲
by
josevalim
2y ago
> I’m still looking back at Elixir with nostalgia, wondering if I’m going to have a chance to go back to it and really make it an extension of my arms/brain like Ruby had become. You should give it another try. :) You jumped in quit
79.
▲
by
josevalim
2y ago
You don't have to learn the Erlang language (and this is commonly echoed by the community). At a certain scale, you have to learn the runtime, but this is the same for any technology. You have to learn JVM if you are doing Kotlin, ther
80.
▲
by
josevalim
2y ago
> And they say "Oh we didn't care to put much effort into it", Yet Jose Valim himself tried to work on it and didn't fix it. This is inaccurate. I have started looking again into solutions only last week [1]. My suspi
81.
▲
by
josevalim
2y ago
Thanks for vote of confidence! We need to type every data type and every function, so the type system will be rolled out over a long period of time. The 1.17 release meant that we now have a gradual type system, which runs in every code bei
82.
▲
by
josevalim
2y ago
We (Elixir) would rather define lists on top of non empty lists: list(a) = empty_list() or non_empty_list(a) So you should pass non-empty lists everywhere a list is expected. But you can’t pass a list where a non-empty one is expec
83.
▲
by
josevalim
2y ago
Author here. This can be addressed with PG views. You create a view where deleted_at IS NULL and now you query the view instead. Furthermore, if the view is “updatable” (which is the case when it only has filters), you can also do updates a
84.
▲
by
josevalim
2y ago
Author here. You are right, the main downside of the approach in the article is that you have to remember to filter the deleted_at column on constraints and consider how foreign keys cascade. About triggers, we do link at the bottom to an a
85.
▲
by
josevalim
2y ago
Elixir macros are hygienic, so you need to be more explicit if you want to override variables as above. You also need to require macros before using them, but once you do you can kick all the puppies! There is also a guide on meta-programmi
86.
▲
by
josevalim
2y ago
Sorry for the late reply but I wanted to double check before following up. And I am glad I did because I was told my first response was inaccurate. :) It is fair to call both TypeScript and Elixir as set-theoretic type system. The big diffe
87.
▲
by
josevalim
2y ago
Hi elbasti, sorry for the late reply. I didn't find your comment critical at all. I appreciate the feedback, especially when it allows us to improve things. We should always improve the learning curve, regardless of its steepness! Any
88.
▲
by
josevalim
2y ago
Thanks for the link. This is my fault because the sentence is ambiguous. Where it tries to explain that "you need to remember to perform auth checks both", it rather means that you need to protect controller routes and LiveView ro
89.
▲
by
josevalim
2y ago
While both Elixir and TypeScript are structural, they are different type systems. A set-theoretic type system is not one that has unions, intersections, negations, but rather one where the foundation of the type system is represented on top
90.
▲
by
josevalim
2y ago
That's precisely my point. Because Chris runs it in production, it doesn't mean the project is production-ready for everyone. And the fact you ran into roadblocks, doesn't mean they are "mostly for hobby" or are &qu
More ›