4 ms·
Honest question: How do you write so much JS code? (i.e. editor, testing, debugging, running, dev environment, etc.) Thank you.
by c4n4rd 13y ago
Honest question:
How do you write so much JS code? (i.e. editor, testing, debugging, running, dev environment, etc.)
Thank you.
- s-macke 13y agoEditor: Normal text editor with syntax highlightning Testing: Firefox and Chrome Debugging: Function console.log Optimization: JIT inspector for Firefox (incompatible since FF 23) and profiling tools from both browsers So, nothing special involved. Neglecting the redundancy, the source code contains 4000 lines of code. The complicated part was the building of the Linux image and libraries with a toolchain in beta status.
- c4n4rd 13y agoThank you so much for the reply. I was thinking I was doing something wrong with the cycle: edit, save, reload in browser, test it, repeat. Great work and very impressive. Thanks!
- benjamincburns 13y agoProblem is almost nobody writes JavaScript which doesn't manipulate the DOM in some way, so you almost always need to test in-browser. Otherwise, there's no reason why you couldn't write automated tests to exercise most of this in a headless v8. Won't be good for profiling, but it will at least be good for validation/regressions.
- s-macke 13y agoYes, I thought about it. The DOM manipulation and the hardware emulation is separated. Unfortunately with the implementation of worker threads it became more complicated to run this code in headless v8.
- benjamincburns 13y agoCurious to know more about the toolchain bit. Have you messed around with getting it to work with OpenEmbedded or Poky? Also please do feel free to contact me out of band (info in profile). I'd like to implement ethernet support, but if you're halfway through I'd hate to duplicate your effort.
- s-macke 13y agoThe toolchain (uCluibc development) I am using is explained here http://opencores.org/or1k/OpenRISC_GNU_tool_chain http://opencores.org/or1k/OpenRISC_GNU_tool_chain My scripts for the toolchain are published here: https://github.com/s-macke/jor1k-toolchain-builder https://github.com/s-macke/jor1k-toolchain-builder Unfortunately the scripts are broken but show the overall complexity to build the linux image. The ethernet device in jor1k is a dummy right now but the kernel is already prepared to work with this device. So everything I have to do is implementing the correct device which is defined here: https://github.com/openrisc/or1ksim/blob/or32-master/peripheral/eth.c https://github.com/openrisc/or1ksim/blob/or32-master/periphe... But nothing has been done right now. It is not my main priority right now because it would need a server script. And github does not allow this. And there could be a lot of security issues as well if I would add this to a demo.
- benjamincburns 13y agoThanks. I've seen eth.js and was just waiting for OpenCores to approve my membership so that I could start working on it. I didn't realize the spec was on github. I need to look a bit more at how everything is laid together, but my intention is to have eth.js write ethernet frames to a WebSocket, then on the server side read/write frames from/to a TAP device. As for the demo, there's no reason why you can't just turn off the socket for the static demo. Otherwise, I'm intending to host something on DigitalOcean to prove it works. I'm sure whatever it is it will be very simple so I don't wind up with a huge bandwidth bill, but I'm hoping I can think of something that's clever and easy on the wallet. Maybe I'll make it add all machines to one giant subnet or something... we'll see.
- 13y ago