1. Imba (https://imba.io/) 2. Mint Lang (https://mint-lang.com/)
and have been quite impressed.
Are there any other languages like these for the web which takes uncommon approaches and tries to make things faster, easier?
Elm is another which I know about and have played with.
PureScript[1] — been around a long time. Looks a lot like Haskell to me.
Derw[2] — Elm-like, interesting integration with Typescript
Amber[3] — smalltalk for js
Rescript[4] — its been awhile since i last looked at this project (during a catastrophic rebrand) so I'm not sure where this project is at, but it did seem very promising to me at one point.
[1]: https://www.purescript.org/
Conceptually very nice. It is like you take React practicality, Ruby on Rails joy and a decent (but not full!) dose of Elm purity and correctness. I am porting a hobby project over to it right now, and then hopefully build more with it, and then eventually maybe contribute.
I also really like Elm, but the problem I have with it is needing all state updates to be centralized, and the kind of coding patterns that leads to. Some people like this, but I prefer the more React-like looseness where objects can have their own private state and so on. Even if that means I give up time travel debugging and so on.
Another uncommonish one is Elixir/Phoenix. I was going to learn this but it felt like 'work' to learn, whereas Mint didn't. And that is mostly to do with how my brain works. I think also Mint optimizes for joy for small projects, whereas Phoenix will come into it's own when you need to scale up, and it is easy to do so, in my opinion.
Since Firebase (or it's competition) can give me live updates, I don't feel I really "need" to learn Phoenix for any use case I will get into.
I haven't made any public releases yet and I'm not sure if the project is mature enough to receive any attention so I'm not posting a link at this point
Example of a simple component:
%div Hello
State and callbacks: :ruby
Button = import("./Button")
def self.get_initial_state(initial_count: 0, **props) = {
count: 0
}
def handle_click(event)
update do |state|
{ count: state[:count] + 1 }
end
end
%div
%p
Count: #{state[:count]}
%Button(onclick=handle_click)
Increment
And it's async so if you want to make a component that shows the current time: :ruby
def mount
loop do
update(time: Time.now.to_s)
sleep 0.5
end
end
%p Current time: #{state[:time]}