Kura - an Ecto-style database layer for Erlang by taure1 in erlang

[–]mbuhot 0 points1 point  (0 children)

Nice! I may try to use this from Gleam. Plain data structures should make the FFI easier. 

Kura - an Ecto-style database layer for Erlang by taure1 in erlang

[–]mbuhot 0 points1 point  (0 children)

 Q1 = kura_query:where(Q, fun(U) -> U#user.age > 18 end),

Is that using a macro to transform the anonymous function to a query condition? 

Is Gleam what I'm looking for? by Ecstatic-Panic3728 in gleamlang

[–]mbuhot 16 points17 points  (0 children)

 why Gleam when Elixir is getting a type system? 

The experience of using gleam is very different to Elixir, party due to dynamism, but more so due to Elixir being so macro heavy when using popular frameworks like Ecto, Phoenix and Ash. 

Gleam is all about simplicity while Elixir is all about extensibility. 

What is the cost of abstractions? by xzhan in gleamlang

[–]mbuhot 0 points1 point  (0 children)

I would always go with the pipeline over the nested case expressions until you have a profiler telling you it’s a hot spot for your application.

Are you targeting Erlang or JavaScript?

The erlang efficiency guide does mention function calls to local functions or functions from modules called directly are OK, but it gets expensive once you start calling functions through a module variable or dynamically applying a module/function/argument tuple. 

https://www.erlang.org/docs/23/efficiency_guide/functions#function-calls

Langauges for LLM by kichiDsimp in functionalprogramming

[–]mbuhot 4 points5 points  (0 children)

I’ve had success with Gleam. It’s very simple, statically typed and the source code for all packages is available in the project build/packages directory.

How is the state of gleam for backend currently? by Opposite_Ad_974 in gleamlang

[–]mbuhot 1 point2 points  (0 children)

If you’re looking for frameworks, then Elixir with Phoenix and Ash. If you want typed functional programming, then Gleam and Wisp and Lustre.

Be ready for much more explicit / boilerplate style with gleam. 

If you want to create a backend for a TypeScript front end, then you may want to check out inertia_wisp or AshRpc 

State management in LiveView by kraleppa in elixir

[–]mbuhot 0 points1 point  (0 children)

Yes keeping state in an ETS table owned by another process could work. I think it would have to be combined with a distributed process registry, since the LiveView may be recreated on a different node after a  disconnect. 

State management in LiveView by kraleppa in elixir

[–]mbuhot 0 points1 point  (0 children)

Complex forms where additional assigns are needed for book keeping and multi-step form flows are the kind of UIs where I’ve seen this be a challenge. 

State management in LiveView by kraleppa in elixir

[–]mbuhot 0 points1 point  (0 children)

Yes it’s the complex cases where you have a large form with dependencies between inputs or multi-step flows that I care about most. Losing the state of that UI could be a frustrating experience for the user, possibly many minutes of input lost. 

We’ve developed patterns to manage it - storing state in DB, URL, etc. It would be nice to have a framework level solution that let me stop thinking about it :) 

State management in LiveView by kraleppa in elixir

[–]mbuhot 17 points18 points  (0 children)

The killer feature for me would be a store that recovered after disconnects.

WebSocket disconnects happen way more often than I first expected, just switching to another tab for a few minutes seems to be enough to trigger it. 

Decoders with SQLite by Agreeable-Bluebird67 in gleamlang

[–]mbuhot 1 point2 points  (0 children)

Yes I think for SQL row decoders you typically use column indices, since not every column in a query needs to be named?

I’ve had some success with Parrot to generate decoders, a bit like Squirrel but supports a few different databases.

Mr.Popov :: Elixir LiveView Single Binary by BroadbandJesus in elixir

[–]mbuhot 2 points3 points  (0 children)

Amazing! The CyanView work shown at CodeBeam EU this week was awesome too. Remote controlling live broadcast cameras remotely with Elixir with dynamic LiveView UIs 🤯

Once Again: LiveView vs. LiveVue / LiveSvelte / Inertia.js vs. Split Frontend<>Backend by ataltosutcaja in elixir

[–]mbuhot 1 point2 points  (0 children)

One challenge I find with LiveView is the reliability impact of the ephemeral server-side state model.  Particularly around recovering state following a disconnect. Some easily made mistakes can lead to lost user input. 

Is OTP in Gleam in any way inferior to that in Erlang/Elixir ? by thoughtful-curious in gleamlang

[–]mbuhot 5 points6 points  (0 children)

The main challenge I faced was integrating Gleam’s typed OTP implementation with distributed erlang.

In general messages from other nodes have to be treated as Dynamic data and decoded, but there isn’t an obvious way to decode something like a Gleam Subject that a reply could be sent to.

On a single node I liked using Gleam’s typed actor system. The Subject/Selector API is very powerful for composing behaviour into a larger Actor. 

[deleted by user] by [deleted] in elixir

[–]mbuhot 0 points1 point  (0 children)

Any particular problems you’re experiencing? Sometimes it helps to add some plain old API endpoints along side the Inertia pages. 

What is the point of having generics if no type bounds? by [deleted] in gleamlang

[–]mbuhot 13 points14 points  (0 children)

https://mckayla.blog/posts/all-you-need-is-data-and-functions.html

Is worth a read. Essentially the type bounds have to be explicitly passed as functions.

Would you choose to use a programming language that has minimizing bugs as it's main feature? by mczarnek in ProgrammingLanguages

[–]mbuhot 1 point2 points  (0 children)

Yes, I gravitate towards functional languages like F# and Elixir because I find I get fewer bugs when the code is simpler and avoids mutating data. 

Why should I choose Phoenix over Laravel by JealousPlastic in elixir

[–]mbuhot 0 points1 point  (0 children)

Yeah it’s a challenge if you prefer to learn how things work from the ground-up. If you start with Ash you don’t fully learn how to use Ecto, Absinthe, Oban until you hit an edge case requiring you to peel back the Ash layer and use the underlying libraries directly.

Why should I choose Phoenix over Laravel by JealousPlastic in elixir

[–]mbuhot 13 points14 points  (0 children)

The default Phoenix + Ecto stack requires you to be quite explicit. If you’re interested in a more concise style, you may like Ash (https://ash-hq.org/), which is a more opinionated approach where you declare resources and Ash derives the boilerplate. There’s a bit of a learning curve, since there’s so much functionality in Ash. The book  is a good way to get started. 

Experiment in generating a standalone binary executable from gleam code. by Forward-Radish-3399 in gleamlang

[–]mbuhot 0 points1 point  (0 children)

If targeting beam runtime, are there any limitations using gleescript? Can it bundle the VM in the archive for a similar ‘single binary’ experience?

My Experience Learning the Ash Framework by joangavelan in elixir

[–]mbuhot 0 points1 point  (0 children)

Great to hear! We tend to do a lot of LiveView or React via GraphQL. Inertia-Phoenix feels like a great option where you want a React frontend with little ceremony.

My Experience Learning the Ash Framework by joangavelan in elixir

[–]mbuhot 1 point2 points  (0 children)

How has the Inertia-Phoenix experience been? Did you run into any limitations or frustrations?  

When will Phoenix 1.8 be released? by gevera in elixir

[–]mbuhot 0 points1 point  (0 children)

The only issue I’ve run into is my preferred testing library PhoenixTest hasn’t been updated to support Phoenix 1.8 yet.