4 ms·
I feel like constraints are where developers get to shine. On a system with (relative) unlimited resources, many developers seem to be able to complete the same
by sixothree 7y ago
I feel like constraints are where developers get to shine. On a system with (relative) unlimited resources, many developers seem to be able to complete the same tasks. But when there is scale involved or some constraint (like 4 mb of storage) you get to find out who is willing to learn what they need to learn to get the job done.
- thedanbob 7y agoMy day job is web development but I love hacking on microcontrollers in my spare time. One project involved serving a static webpage from an ESP-8266. But how do you server an HTML file without a filesystem? There's probably a better way, but my solution was to gzip the file and embed it as an array of raw bytes within the program.
- Koshkin 7y agoAs far as program resources go, on DOS, at least, it used to be possible to simply append a file to the executable, and the loader would put everything in RAM. (On the other hand, you do not need a generic web server to serve a single static page; then you don’t need a file system to store one file.)
- emily-c 7y agoThis is still pretty common for things like self extracting archives on Windows. copy /b "%windir%\system32\extrac32.exe"+inputarchive.cab selfextract.exe
- ronsor 7y agoYou can do that with most executable formats: MZ/NE/PE (DOS, Windows), ELF (Linux, BSD). Not sure about mach-o (macOS) though.
- wolf550e 7y agoDo you mean like Apache mod_asis [0] which will serve a pre-formatted HTTP response, including the headers, directly from disk? Then your HTTP server can speak very little HTTP (compare request line to preformatted "GET /file HTTP/", return 404 on mismatch, return preformtted response on match). Maybe also return nice error if request does not have accept-encoding: gzip. 0 - https://httpd.apache.org/docs/2.4/mod/mod_asis.html https://httpd.apache.org/docs/2.4/mod/mod_asis.html
- GTP 7y agoESP8266 has basic filesystem support, have a look at this: https://arduino-esp8266.readthedocs.io/en/latest/filesystem.html https://arduino-esp8266.readthedocs.io/en/latest/filesystem..... You define the filesystem's size when you flash the ESP and there's a tool to upload files there. You should also be able to find example projects that serve a webpage read from SPIFFS. Edit: this is a fake AP for esp8266 that I wrote some time ago that has a captive portal that loads pages from SPIFFS if they're there, otherwise sends some default pages directly from code https://github.com/GTP95/CaptivePortalMatematico?files=1 https://github.com/GTP95/CaptivePortalMatematico?files=1
- thedanbob 7y agoCool! I ended up switching to a raspberry pi for that particular project but I'll keep that in mind.
- deckard1 7y agohttps://github.com/me-no-dev/ESPAsyncWebServer#respond-with-content-coming-from-a-file https://github.com/me-no-dev/ESPAsyncWebServer#respond-with-... That whole ESPAsyncWebServer github project has a lot of great examples on ways to use the esp8266. Also, if you want to connect to your esp8266 externally, you can setup nginx (maybe on a raspberry pi?) as a reverse proxy with TLS enabled: https://jjssoftware.github.io/secure-your-esp8266/ https://jjssoftware.github.io/secure-your-esp8266/. Probably a bit pointless if you only have one esp8266 to connect to, since the RPi could probably do it all. But if you have multiple IoT devices to connect to, might be worth it.
- invalidOrTaken 7y agoThe nice thing about constraints is that they know what they want.
- quotemstr 7y agoThat's a very pithy way of putting it
- 1-6 7y agoGoogle Sheets is my constraint. Utilities.sleep()
- reaperducer 7y agoI feel like constraints are where developers get to shine. Absolutely. And I think that's one of the ways you can tell that there is an art to programming. It's not just pushing buttons in the right order. (Something my boss doesn't understand because she took a computer class in high school and thinks she can do my job. "I know code.") Computer science is a thing. Programming is a thing. They're not the same thing. And as we get into more abstractions, I feel like the programming side is becoming more an art form than the science it is presumed to be.
- 0x445442 7y ago> Computer science is a thing. Programming is a thing. Engineering is also a thing but that's vanishing too.
- dec0dedab0de 7y agoI always liked how rms says that programming is a craft.
- jlg23 7y agoIt's the litmus test: How much of taught abstractions do you really understand (can you adhere to the underlying coding practice without spelling it out in (costly) code? Do you really understand a runtime environment and can you make your basic tool, the compiler, optimize for your use-case? Back then, when I was young and stupid, I agreed to develop a Command & Conquer like game in j2me with a deliverable size of max 120k. I did, but that required lot of all-nighters and a severely bruised and corrected ego.. And, as the senior dev, I got to listen to very smart recently graduated devs who did not know shit (as I did when I started). Best management lesson ever...
- SkyMarshal 7y agoThere are a bunch of styles of X-Driven-Development, and I honestly think we should add the notion of Constraint-Driven-Development as a first-class citizen to that mix. CDD. Start by specifying the constraints, including hardware, software, formal specification, and business rules. Put them all into a Constraints Document. Then tell the engineering and design teams to work together to make the coolest, most creative product they can, without violating the specified constraints. Use Agile, rapid-iteration methodologies if you like, within that framework. Then evaluate the outcome, and decide whether to iterate by updating the constraints document and repeating the process. Or maybe you’re happy with v1.0 and no iteration necessary. Constraints drive both innovation and quality. I wonder if the process can be viably formalized in such a manner.
- Someone 7y agoAs Goethe wrote: ”In der Beschränkung zeigt sich erst der Meister” (“the master shows himself through self-limitation”). One can see this as a form of constrained writing (https://en.wikipedia.org/wiki/Constrained_writing https://en.wikipedia.org/wiki/Constrained_writing) Demos (https://en.wikipedia.org/wiki/Demoscene https://en.wikipedia.org/wiki/Demoscene) and The submissions to the International Obfuscated C Code Contest (http://ioccc.org/ http://ioccc.org/) also are examples of this.
- userbinator 7y agoIf you like constraints, you'll probably enjoy https://en.wikipedia.org/wiki/Demoscene https://en.wikipedia.org/wiki/Demoscene . Some productions have made it onto HN, like https://news.ycombinator.com/item?id=11848097 https://news.ycombinator.com/item?id=11848097 and https://news.ycombinator.com/item?id=14164907 https://news.ycombinator.com/item?id=14164907 or even https://news.ycombinator.com/item?id=9338944 https://news.ycombinator.com/item?id=9338944