DEV Community

[Comment from a deleted post]
Collapse
 
adam_cyclones profile image
Adam Crockett 🌀 • Edited

I accidentally learned c++ because I fell in love with this other language, Lua, to get this working with JavaScript and WASM I needed to write some c++ and call the Lua c API.

The above would have been harder had I not spent a hell of a long time rotating between languages writing hello world's and moving on, that and using typescript.

The most important part to being polyglot, open your mind.

This is how in Lua you attach a method to a table.

function mylib.foo(...)
    -- Do stuff
end

This is how in JavaScript you can attach a method to an object

let mylib = {
   foo(...args) {
     // Do stuff
   }
};

I love both syntax but I can't help but think a lot of modern es6 came from Lua.