5 ms·
As an embedded developer I shudder to think of all of the work that would go into /runtime run source/ to have it build objects, link them into some kind of for
by throwway120385 3y ago
As an embedded developer I shudder to think of all of the work that would go into /runtime run source/ to have it build objects, link them into some kind of format, convert the format to a series of flash addresses and data, connect to my JTAG over a network, halt execution, erase the flash, load the executable file into flash, verify the load, and try to signal a PMIC or other chip to reset the device to start it back up.
Or you could just read "Linking a single object file" from the GNU Make manual's catalogue of rules, which describes how to do exactly what you want with the caveat that you still have to run the program after it's built and linked: https://www.gnu.org/software/make/manual/html_node/Catalogue-of-Rules.html https://www.gnu.org/software/make/manual/html_node/Catalogue...
- breadchris 3y agohave you ever used tinygo? I have been curious how much that project gets used. It seems to me that rust is probably going to be the language of choice some point in the future.
- floating-io 3y agoI looked at that recently for a project I'm working on, but walked away when I found that important parts of the net package are pretty much nonexistent on ESP32. You know, like net/http, for example... I might have misread the docs, but somehow I doubt it.
- breadchris 3y agoyeah it looks like you are right: https://arc.net/l/quote/veycnsqt https://arc.net/l/quote/veycnsqt
- randomdata 3y agoThe Go standard library's net/http package doesn't yet compile due to some dependency issues, but tinygo provides its own net/http package to stand in as a replacement[1]. [1] https://pkg.go.dev/tinygo.org/x/drivers/net/http https://pkg.go.dev/tinygo.org/x/drivers/net/http
- reactordev 3y agoAs I stated, for C/C++ - folks like their build systems the way it is. For everyone else, they want runtime run sourcefile and can then build scripts around that to package it up how they want to. For local development, I shouldn't have to wait 40 minutes for a compile to see a div change. The toolchains that would benefit from being able to run quickly, compile quickly, are what we want. Having to do 15 steps to get your code on an embedded device is just part of the territory. The rest of us have pipelines.
- bjackman 3y agoYou have to do that work anyway... Why not encode it in your build system? (Admittedly I have never tried this with a modern build system. My real world approach for that would be a janky phony rule in a Makefile, with a bunch of MAKE_VARS the user has to set on the cmdline/in the environment to set up the toolchain/serial port etc. But in principle I have always believed it should be possible to make this process as easy as compilation)
- reactordev 3y agoAre those vars discoverable? As in can you infer what they should be? If you can’t, or are building for all unknown possibilities, wouldn’t it be safer to enumerate known var values to perform that? Why must everything be explicit? Wrap it all up into one var. cmake -DBUILD_FOR=esp32 . Then provide your own little runtime.sh. For other languages and build systems, a runtime run sourcefile is the easiest way to get someone going, leave the edge cases out. Just get it running so they can hack on it.
- bjackman 3y agoNo, you have to manually document them and then the docs go out of date and you can't realistically set up CI for this little runner script so certain use cases get broken and blah blah blah and it sucks! Same for runtime.sh. This is why the 'runtime run source' is so useful! I'm totally on board with it. I just don't think we need one implementation per ecosystem. One runner per project (the 'make run' approach) is worse than one per ecosystem, which is in turn worse than just having one for everything!