Live data from Hacker News

Nova: A New Web Framework for Erlang

news.ycombinator.com

31–33 of 33 posts

Re: Nova: A New Web Framework for Erlang

#31

Earlier quoted context omitted.

It should also be noted that handling state like that is not really idiomatic Erlang. State is updated at a process level, thus traditionally you spawn another process which is trivial to do. On the BEAM that is fast enough for 95% of cases. If you really need mutation on local variables for performance reasons, you should already be writing NIFs anyways. State variables are what I think corpos call a "code smell". T…

> It should also be noted that handling state like that is not really idiomatic Erlang. It's not about the state but about intermediate results. When you have a value that you pass to one function, and then you need to pass the result to another function, you're not dealing with a "state" as OTP defines it, unless the calls are asynchronous. Often, they're not, and that's where variable rebinding comes in. Worth noti…

There are some libraries (based on parse transforms) that introduce a sort of "do" notation to deal with this issue (erlando and its variations come to mind).

Also, the latest versions of OTP have introduced the `maybe` expression: https://www.erlang.org/eeps/eep-0049

Re: Nova: A New Web Framework for Erlang

#32

Earlier quoted context omitted.

> It should also be noted that handling state like that is not really idiomatic Erlang. It's not about the state but about intermediate results. When you have a value that you pass to one function, and then you need to pass the result to another function, you're not dealing with a "state" as OTP defines it, unless the calls are asynchronous. Often, they're not, and that's where variable rebinding comes in. Worth noti…

There are some libraries (based on parse transforms) that introduce a sort of "do" notation to deal with this issue (erlando and its variations come to mind). Also, the latest versions of OTP have introduced the `maybe` expression: https://www.erlang.org/eeps/eep-0049

I love it. I didn't know. It's going to take a while to make this a pervasive feature of most Erlang codebases, but it seems like a good feature to introduce.

I know there are monad libraries using parse transforms and/or list comprehensions, but I often found their use is frowned upon in the Erlang community. I kind of assumed the GP in this thread would reject them, given their negative opinion on macros.

Re: Nova: A New Web Framework for Erlang

#33

Earlier quoted context omitted.

There are some libraries (based on parse transforms) that introduce a sort of "do" notation to deal with this issue (erlando and its variations come to mind). Also, the latest versions of OTP have introduced the `maybe` expression: https://www.erlang.org/eeps/eep-0049

I love it. I didn't know. It's going to take a while to make this a pervasive feature of most Erlang codebases, but it seems like a good feature to introduce. I know there are monad libraries using parse transforms and/or list comprehensions, but I often found their use is frowned upon in the Erlang community. I kind of assumed the GP in this thread would reject them, given their negative opinion on macros.

I was in a similar situation, ended up relying on libs that used parse transforms a lot and then found out most of my usage could have been replaced by the new `maybe` expression.
Post reply on HN