DEV Community

Discussion on: NULL, "The Billion Dollar Mistake", Maybe Just Nothing

Collapse
 
deciduously profile image
Ben Lovy

Great write-up! The languages whose implementations of Maybe I've tried don't seem have anything quite as handy as that decorator pattern. I think you've got a MojiScript convert.

Collapse
 
joelnet profile image
JavaScript Joel

The decorator pattern is nice for sure. It would be cool JavaScript let you write it like this:

@maybe
const toupper = string => string.toUpperCase()

You can do that for methods on a class, but not standalone functions.

Hop over to the Discord chat and say hi!

Collapse
 
joelnet profile image
JavaScript Joel

Do you currently write functional JavaScript? What do you currently use?

Collapse
 
deciduously profile image
Ben Lovy

I do not - all of the frontend projects I have worked on have been either ReasonML, ClojureScript, or Elm. I'm transitioning to TypeScript now and am on the prowl for best practices - this post was the first I'd ever heard of MojiScript.

Thread Thread
 
joelnet profile image
JavaScript Joel

MojiScript is new new new. Just created the "initial commit" on Aug 29!

I'm fascinated by ELM but have never used it. What are your thoughts on it?

Thread Thread
 
deciduously profile image
Ben Lovy

Whoa - no kidding! Congratulations. I'm definitely excited to play with it.

I wanted to like Elm a lot more than I actually did. The language feels like a pared-down Haskell - PureScript is more interesting to me from a language perspective.

The Elm Architecture resonates with me, and I'm excited by the adaptations I'm seeing pop up for F# and Reason and PureScript.

It's got a bus factor of exactly 1, and 0.19 broke all my stuff. Breaking changes are to be expected with a a young project, but I'm just not quite sold on the ecosystem as a whole.

People do some really cool things with it, but I'm banking on the Architecture to bleed into other more widely used tools as opposed to Elm itself taking over the world.

Thread Thread
 
joelnet profile image
JavaScript Joel • Edited

Whoa - no kidding! Congratulations. I'm definitely excited to play with it.

Your feedback would be very beneficial in helping me drive the direction of MojiScript!

Man, that game boy emulator is insane...

Ahhh ya that was my fear. I love reading about ELM. It seems like everything I want. But then there's the issues with having to deal with JavaScript libraries. Because, let's face it, npm is what makes JavaScript great. Without libraries, I could use any language.

So interop with JavaScript was important to me.

That was a key decision to keeping MojiScript as JavaScript. There's just so much JavaScript already has, package management, build tools, community, browsers, node, etc.

Keeping the JavaScript comes with some limitations but it provides soooo much more that it becomes worth it.

Next up is to create an awesome development and debugging experience. I just merged some (what I think are) revolutionary debugging tools. More on that when I get time ;)

Thread Thread
 
deciduously profile image
Ben Lovy

I'm very much a novice, but I'll absolutely be proactive about interacting with the project as I explore the tool. Looking forward to your next post!

Thread Thread
 
joelnet profile image
JavaScript Joel

Here's a sneak peek:

The //? is a command from Quokka that evaluates the code live. So to the right of the //? code is a live evaluation of the value on the left.

But look at that stack trace...

vs code screenshot

Rich Boy dat meme face

This is a WIP so it'll only get better... :D

Thread Thread
 
deciduously profile image
Ben Lovy

...ok, whoa. That's some seriously cool stuff.

Thread Thread
 
joelnet profile image
JavaScript Joel

I think so... but you know, I am biased ;)