News for hackers. Stuff that matters.
Re:KnightOS was an interesting operating system by sixothree on Tuesday January 28, 2020 @09:51AM (#22169851)
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.
Re:KnightOS was an interesting operating system by jlg23 on Tuesday January 28, 2020 @02:19PM (#22173062)
It'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...

Re:KnightOS was an interesting operating system by invalidOrTaken on Tuesday January 28, 2020 @10:03AM (#22169978)
The nice thing about constraints is that they know what they want.
Re:KnightOS was an interesting operating system by quotemstr on Tuesday January 28, 2020 @11:06AM (#22170611)
That's a very pithy way of putting it
Re:KnightOS was an interesting operating system by SkyMarshal on Tuesday January 28, 2020 @03:18PM (#22173618)
There 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.

Re:KnightOS was an interesting operating system by Someone on Tuesday January 28, 2020 @04:17PM (#22174126)
As 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)

Demos (https://en.wikipedia.org/wiki/Demoscene) and The submissions to the International Obfuscated C Code Contest (http://ioccc.org/) also are examples of this.

Re:KnightOS was an interesting operating system by thedanbob on Tuesday January 28, 2020 @10:00AM (#22169959)
My 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.
Re:KnightOS was an interesting operating system by GTP on Tuesday January 28, 2020 @10:57AM (#22170508)
ESP8266 has basic filesystem support, have a look at this: 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
Re:KnightOS was an interesting operating system by thedanbob on Tuesday January 28, 2020 @11:31AM (#22170908)
Cool! I ended up switching to a raspberry pi for that particular project but I'll keep that in mind.
Re:KnightOS was an interesting operating system by deckard1 on Tuesday January 28, 2020 @01:58PM (#22172832)
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/. 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.

Re:KnightOS was an interesting operating system by wolf550e on Tuesday January 28, 2020 @10:54AM (#22170484)
Do 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

Re:KnightOS was an interesting operating system by Koshkin on Tuesday January 28, 2020 @10:44AM (#22170383)
As 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.)
Re:KnightOS was an interesting operating system by emily-c on Tuesday January 28, 2020 @11:06AM (#22170610)
This is still pretty common for things like self extracting archives on Windows.

  copy /b "%windir%\system32\extrac32.exe"+inputarchive.cab selfextract.exe
Re:KnightOS was an interesting operating system by ronsor on Tuesday January 28, 2020 @11:57AM (#22171231)
You can do that with most executable formats: MZ/NE/PE (DOS, Windows), ELF (Linux, BSD). Not sure about mach-o (macOS) though.
Re:KnightOS was an interesting operating system by reaperducer on Tuesday January 28, 2020 @12:14PM (#22171414)
I 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.

Re:KnightOS was an interesting operating system by 0x445442 on Tuesday January 28, 2020 @12:27PM (#22171568)
> Computer science is a thing. Programming is a thing.

Engineering is also a thing but that's vanishing too.

Re:KnightOS was an interesting operating system by dec0dedab0de on Tuesday January 28, 2020 @02:11PM (#22172967)
I always liked how rms says that programming is a craft.
Re:KnightOS was an interesting operating system by userbinator on Tuesday January 28, 2020 @08:18PM (#22176164)
Re:KnightOS was an interesting operating system by 1-6 on Tuesday January 28, 2020 @10:49AM (#22170434)
Google Sheets is my constraint. Utilities.sleep()