\

Small Programs and Languages

100 points - yesterday at 9:44 PM

Source
  • zzo38computer

    today at 2:35 AM

    I have written some useful small programs in uxn, such as: hex decoder in 39 bytes (which handles optional spaces and line breaks, uppercase and lowercase, etc), a program to convert JSON to NDJSON in 125 bytes, a program to convert DER to a subset of TER in 220 bytes, BLAKE2s in 1024 bytes (although some of it is padding for alignment, which is why it comes out to exactly 1024), a card game (including graphics, sound effects, fonts, scoring, etc) in 1853 bytes, etc. (These do not always check for errors (although the card game does check that you had made a valid move), which is one of the things that makes them short; since you might want such things sometimes that makes other programs longer, and this is not specific to uxn or to programs I wrote.) Other people might have also done.

    The description of uxn and varvara are also small and might need only two pages (I did not write it).

    I also remember reading in a book that someone made a game on Atari in 2 kilobytes, and described how they could make it fit (by making the map symmetric, etc), which was rejected because they had 4 kilobyte cartridges by then. (The article in this submission also links to a different game that (probably) someone else made in 2 kilobytes, but this time with JavaScript and HTML. Atari and uxn/varvara are much simpler systems than HTML/JavaScript, though.)

      • WalterBright

        today at 6:42 AM

        Hal Finney wrote a BASIC interpreter for the Mattel Intellivision in about 2K of ROM.

        Of course, Hal was a genius.

    • shikaan

      today at 7:24 AM

      Great read (: This is precisely how I learn, even though these days it all feels a little futile.

      The other part for me is working within tight constraints. A couple of years back I made an Operating System that fits a bootloader (I was low-key hoping to find in the list :P) Not really golfing but surely a good exercise in playing within constraints.

      If anybody wants to take a look https://github.com/shikaan/osle

      • bryancoxwell

        today at 12:26 AM

        This was such an enjoyable read. I’ve been a bit meh on software development recently and this really re-piqued some old interests.

        • rramadass

          today at 3:09 AM

          Little Languages by Jon Bentley - https://news.ycombinator.com/item?id=40989069

          Constructing Language Processors for Little Languages by Randy Kaplan - https://www.amazon.com/dp/0471597538?lv=shuf&channelId=500&p...

          • anthk

            today at 2:26 AM

            https://t3x.org

            Also, JimTCL.

              • rramadass

                today at 3:18 AM

                That's a very interesting website with a lot of info.

                Thanks for sharing.

            • hexjy

              today at 7:45 AM

              [flagged]

              • deakmisra

                today at 6:59 AM

                [flagged]