loading...

If you made a subset of your favourite language, what would you keep.

github logo Updated on ・1 min read

If you had to use just one language for the rest of your life and that was nearly a reduced version of your primary language, what 3 features would you simply not be able to live without?

For me it would be JavaScript with:

  • WebAssembly
  • Promises
  • spread and destructure

WebAssembly because then I would use another language.

twitter logo DISCUSS (5)
markdown guide
 

F#: higher order functions, pattern matching, and easy interoperability with .NET.

Okay, that last one has never existed but damn it would be nice πŸ™ƒ

 

I was going to say, beacuse I'm interested in F#, and interop would make this language more prevalent. unfortunately I am in interested in most languages and there is a queue of things to try forming. I like pattern matching too, but as js doesn't have it I couldn't say that.

 
 

TBH I haven't totally mastered them and thus learned to appreciate their power. Thanks for reminding me to add that to my todo list!

 

So the rules are pretty unclear to me, but I'll assume you don't need to explicitly choose prinitives and operators, but not structures like if, for loops, switch, function definitions and objects.

So to be able to recreate objects we need functions (see nr 2#), arrays (for multiple returns) and decision making. For taking decisions we can use the ternary operator so my 1# will be arrays (maybe not object based, just the most dummy arrays ww can get)

You can implement promises yourself if you have higher order functions, so my 2# would be higher order arrow functions

Since we have functions, taill call optimization is essential for implementing looping over stuff, so that would be my 3#

Classic DEV Post from Jul 2 '19

How to refill someone’s β€œcup?”

Sometimes we rely so much on our friends and coworkers that we often forget to ma...

Adam Crockett profile image
I work at ForgeRock as a Front End Engineer, I play with all sorts really. Lately WASM is my toy of interest.

Sore eyes?

dev.to now has dark mode.

Go to the "misc" section of your settings and select night theme ❀️