Live data from Hacker News

Strong arrows: a new approach to gradual typing

elixir-lang.org

11–20 of 87 posts

Re: Strong arrows: a new approach to gradual typing

#11
post #5

Earlier quoted context omitted.

I don't thinks that would be a helpful discussion right here. Any one point there might come someone who points at some external "solution" (package, tool, ...) that might also do the same feature in some way for X, ignoring the fact that there are lot of Y without that particular thing still, but leads into derailing the argument anyways. Elixir (and esp. Phoenix for web dev) is more like the culmination of the best…

I would add some more points. 6. Livebook, Jupyter notebook are amazing in Python, Livebook is the same but for Elixir. Also you can connect to your running environment and interact with it. 7. The Nx ecosystem, ML is not only a Python thing now, Elixir is completely usable for ML now. 8. Ash framework, this is not a web framework but a framework for your domain, it's amazing

absolutelt hard agree on livebook, but I think thats not an immediate thing every webdev needs.

but speaking from recent practice, it is laughably simple and kinda mindblowing for non-experts in this stuff. Like, I klick me a few smart cells to interact with external data and get a connection/data, write a few straightforward logic modules to do something, and a super simple form for users of this thing (like two inputs and a submit button, and an event handler) and I can eliminate a business workflow or report. I can call a dev into it ad-hoc to help with a code snippet like a liveshare-coding-session. And finally I deploy it to a bookmarkable URL with a password.

Maybe an hour worth of work, _including_ talking with people while fleshing this out in quick iterations as-we-speak.

I mean people kinde get how cool phoenix is for one reason or the other, but livebook is really killing it for me. It's hard to talk with business people about tech internals no matter how awesome, but its a different game with lightweight livebooks. If you also happen to have phoenix as your actual product/app, linking the livebook indeed is nice to directly call functions instead of rewriting those snippets in SQL... but the endgame here is when the livebook starts to become unwieldly due to increasing feature requests, it can be integrated into a phoenix app rather easily, since a dev starts out with working code to begin with (and can play with it interactively).

Re: Strong arrows: a new approach to gradual typing

#12
post #3

I cannot support much in terms of money or time currently, but somehow I'd wish there are ways to speed this up. Sure, sponsoring from big corps comes with their own problems, but maybe that would be an option? There are quite some that use Elixir (or BEAM in general) out there... Idk what would be the best approach. But I am very convinced that Elixir and the wider ecosystem (not only phoenix liveview) is (or could…

I read that Brex moved away from Elixir to Kotlin. If Elixir was really that great then why would a company put such a big effort to ditch it? That killed off my interest in learning it, but maybe their reasons were invalid? Genuinely curious.

Re: Strong arrows: a new approach to gradual typing

#13
When we talk about arrows in terms of functional programming, we really mean Hughes’ Arrows (or Freyd-categories) a generalization of monads. The term arrow represents a level of abstraction over computations, essentially modeling them as objects with inputs and outputs. Hughes' Arrows extend beyond the traditional notion of functors and monads in handling side effects and common computational patterns in a more structured manner.

Arrows are useful because they provide a computation model that can implicitly make use of state without ever exposing that state to the programmer. The programmer can use arrowized computations and combine them to create sophisticated systems.

A strong arrow is an arrow A having an extra structure known as strength. The strength for A is a natural transformation, generally denoted by t, which consumes a pair of objects (X,Y) and gives back an arrow in the category. In a concrete manner, the strength has this form: t_X,Y: X x AY -> A(X x Y), called tensorial strength. The strength obeys some particular coherence conditions. A deeper explanation involves the monoidal structure of a category and how the 'strength' aids in elaborating the combination of values in the arrow context.

Re: Strong arrows: a new approach to gradual typing

#14
post #12
post #3

I cannot support much in terms of money or time currently, but somehow I'd wish there are ways to speed this up. Sure, sponsoring from big corps comes with their own problems, but maybe that would be an option? There are quite some that use Elixir (or BEAM in general) out there... Idk what would be the best approach. But I am very convinced that Elixir and the wider ecosystem (not only phoenix liveview) is (or could…

I read that Brex moved away from Elixir to Kotlin. If Elixir was really that great then why would a company put such a big effort to ditch it? That killed off my interest in learning it, but maybe their reasons were invalid? Genuinely curious.

I hear new Cto came in, got nervous about hiring. They are still hiring for elixir positions, though?

Re: Strong arrows: a new approach to gradual typing

#15

Earlier quoted context omitted.

I would add some more points. 6. Livebook, Jupyter notebook are amazing in Python, Livebook is the same but for Elixir. Also you can connect to your running environment and interact with it. 7. The Nx ecosystem, ML is not only a Python thing now, Elixir is completely usable for ML now. 8. Ash framework, this is not a web framework but a framework for your domain, it's amazing

absolutelt hard agree on livebook, but I think thats not an immediate thing every webdev needs. but speaking from recent practice, it is laughably simple and kinda mindblowing for non-experts in this stuff. Like, I klick me a few smart cells to interact with external data and get a connection/data, write a few straightforward logic modules to do something, and a super simple form for users of this thing (like two inp…

> it can be integrated into a phoenix app rather easily

I can't figure out how to do this.

Re: Strong arrows: a new approach to gradual typing

#16
post #12
post #3

I cannot support much in terms of money or time currently, but somehow I'd wish there are ways to speed this up. Sure, sponsoring from big corps comes with their own problems, but maybe that would be an option? There are quite some that use Elixir (or BEAM in general) out there... Idk what would be the best approach. But I am very convinced that Elixir and the wider ecosystem (not only phoenix liveview) is (or could…

I read that Brex moved away from Elixir to Kotlin. If Elixir was really that great then why would a company put such a big effort to ditch it? That killed off my interest in learning it, but maybe their reasons were invalid? Genuinely curious.

Do you reject learning any language that has been migrated away from by any company? Why not make up your own mind about whether it is nice instead of depending on rumours about other companies?

In any case you could have easily googled "brex elixir" and have found their blog explaining their reasoning as the first result: https://medium.com/brexeng/building-backend-services-with-ko...

Re: Strong arrows: a new approach to gradual typing

#17

Earlier quoted context omitted.

absolutelt hard agree on livebook, but I think thats not an immediate thing every webdev needs. but speaking from recent practice, it is laughably simple and kinda mindblowing for non-experts in this stuff. Like, I klick me a few smart cells to interact with external data and get a connection/data, write a few straightforward logic modules to do something, and a super simple form for users of this thing (like two inp…

> it can be integrated into a phoenix app rather easily I can't figure out how to do this.

By this I mean taking the code logic snippets and slap a dedicated new liveview UI on it within your phoenisx app - which isn't too hard since the initial ui in the livebook is pretty bare bones. Yes its rebuilding the whole thing technically, but probably really quick to do

Re: Strong arrows: a new approach to gradual typing

#18
"gradual typing" is exactly how I code Julia.

Disclaimer: this is not how to the strengths of Julia are normally described by most people, it's just how I think about it.

You might have heard that Julia solves the two language problem (easy as python, fast as C++). But exactly how does it do that? In python you don't have to care about types, but even if you were willing to care about types you wouldn't get any performance benefit. In C++ you have to care about types, you don't have the option not to, even when you don't care about performance.

In Julia you don't have to care about types. You can code it exactly as python. But if you are willing to you can care about types, and you'll get a huge performance benefit. So, the way I code Julia is on a first pass I code it like python. I don't care about types, I just care that it's correct. Then, after it's correct, and if performance is critical, I start thinking about types. So Julia very much lends itself to "make it work, make it right, make it fast", by allowing you to gradually introducing types into the parts of your code that matter.

Re: Strong arrows: a new approach to gradual typing

#19
post #3

I cannot support much in terms of money or time currently, but somehow I'd wish there are ways to speed this up. Sure, sponsoring from big corps comes with their own problems, but maybe that would be an option? There are quite some that use Elixir (or BEAM in general) out there... Idk what would be the best approach. But I am very convinced that Elixir and the wider ecosystem (not only phoenix liveview) is (or could…

Tbf. While more money to allows stability of people involved would help, it would not really speed it up that much.

Typescript had ms behind it and it still took a decade. At some point the engineering, experiments and learning take time and you can hardly speed it up with more ressources.

Re: Strong arrows: a new approach to gradual typing

#20

When we talk about arrows in terms of functional programming, we really mean Hughes’ Arrows (or Freyd-categories) a generalization of monads. The term arrow represents a level of abstraction over computations, essentially modeling them as objects with inputs and outputs. Hughes' Arrows extend beyond the traditional notion of functors and monads in handling side effects and common computational patterns in a more stru…

This was my first thought, but this connection was not made clear in the article - or if it was a naming coincidence.
Post reply on HN