mleku™️ @mleku - 1mo
so, if i understand correctly, there is no easy bridge in js between static and dynamic arrays and arrays of strings and arrays of structs are? only static, only dynamic? that's a pretty harsh limitation i can imagine a possible workaround but it's brutal
clear case of #golang > #javascript if i ever saw one also, hah... all the other popular languages don't have dynamic arrays as first class types shit, go compiles so fast you could distribute web page front end scripts as source and the user wouldn't even notice the compilation delay y'all are gonna see the light eventually... Go is to programming as #bitcoin is to money there is no second best
i should do a talking head gif of Rob Pike with the subtitle "there is no second best" and "Rob Pike on programming languages" as a heading
61404 - 1mo
In JavaScript, the basic Array type is dynamic (no permanently fixed size, no fixed type). Typed arrays (Float32Array etc.) are statically sized at allocation time and only contain the specified type. If you know how many items your dynamic Array is going to hold, you can pass that length into the constructor. const myArray = new Array(100); But this won’t stop you from assigning off the end of the array if you so choose: myArray[999] = ‘foo’; // 👍
WebAssembly (WASM) is a subset of JavaScript to which compiled languages can target. An increasing number of libraries and programs are available this way. For example, there’s an ffmpeg port that lets you transcode video in a WebWorker using WASM.
yes, i am quite aware of #WASM... it is very popular as a runtime for shitcoin "smart" contracts (ie database scripts) it has all the limitations of #javascript, and has to conform to javascript namespaces so the compiling language has to have bindings to the namespace of the javascript environment that spawns it if i'm lucky, i may spend the next 10 weeks or so building a full SDK for a shitcoin WASM runtime that compiles from #golang i think that it's easier to write correct code in a simpler language and rust is more complex that C++, which is more complex than javascript, and what is the biggest cause of hax in shitcoin land? yes. poorly coded access control in smart contracts i figure if i get them to build them an SDK in go then they are kinda obliged to try and get people to use it and maybe save some poor bastards some money at some point in the future