[HN Gopher] BootLogo: Logo language in 508 bytes of x86 machine ...
       ___________________________________________________________________
        
       BootLogo: Logo language in 508 bytes of x86 machine code
        
       Author : thunderbong
       Score  : 195 points
       Date   : 2024-03-19 07:32 UTC (15 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | asicsp wrote:
       | See https://news.ycombinator.com/from?site=github.com/nanochess
       | for discussions on other such amazing projects.
        
         | wingi wrote:
         | Same developer
        
       | yc-kraln wrote:
       | The other day when I was hacking together on some GCode for a
       | small CNC table, it felt somehow very similar to me: I realized
       | that, as a five or six year old, playing with Logo/Turtle
       | graphics on Apple ][ machines--my first interactions with
       | computers--was essentially the same conceptual loop.
        
         | verticalscaler wrote:
         | Programming Computer Animation in 1964 - AT&T Archives:
         | https://www.youtube.com/watch?v=-5mFhDIJfNA
         | 
         | The Wheel of Time turns, and Ages come and pass, leaving
         | memories that become legend. Legend fades to myth, and even
         | myth is long forgotten when the Age that gave it birth comes
         | again.
        
           | lynx23 wrote:
           | -- Robert Jordan
        
         | MisterTea wrote:
         | The same goes for plot(6) on plan 9:
         | http://man.9front.org/6/plot
         | 
         | It's all vectors and arcs though some newer controllers do
         | splines and other curves in hardware during execution using
         | vendor specific instructions.
        
       | igtztorrero wrote:
       | Thank you so much. Logo was the first computer language I
       | learned. Incredible implementation in asm.
        
         | liotier wrote:
         | Same. Logo taught me the only important part of computer
         | science: the computer does what the program tells it to - no
         | more, no less... Everything else in computer science is
         | implementation details and incident factors !
        
           | anthk wrote:
           | Yes, but in the mid 90's, teaching Logo to Elementary
           | students sucked at lot. We barely touched Logo for a week and
           | doing advanced stuff was just something for kids with
           | computers at home with young parents.
           | 
           | I was lucky to get a Debian release from a magazine in early
           | 00's, my relation to computers did a 180 degree turn. That
           | and retroemulation, I even learnt C64 basic just for fun
           | under VICE/CSS64. From that era I loved Perl, text
           | adventures, self-learning from books and lots of howtos on C
           | and PostScript.
        
         | fernandotakai wrote:
         | ah same!
         | 
         | i learned logo in my native language (ptbr) when i was in
         | middle school. it absolutely blew my mind that i could
         | "automatically" draw things.
         | 
         | first thing i did when i got home was ask my dad for it -- it
         | took him to find the proper floppy (he borrowed from a friend
         | that was a CS teacher!).
         | 
         | fun fact: we didn't call it logo, we called it "the little
         | turtle game".
        
       | buescher wrote:
       | I am an unabashed nanochess fanboy but it's not really Logo
       | without lists and functions.
        
         | jhbadger wrote:
         | True. People often think Logo is just turtle graphics, but it
         | really is a complete programming language that is, despite the
         | syntax, actually related to Lisp. Brian Harvey even wrote a
         | series of intro CS texts using Logo that didn't use turtle
         | graphics at all. Brian's home page has the full text of them.
         | https://people.eecs.berkeley.edu/~bh/
         | 
         | (that being said, I get that full Logo would not be possible in
         | 508 bytes)
        
       | rvba wrote:
       | Would it be possible to hack the management engine in such a way
       | that during boot it makes an internet connection and imports some
       | logo from the internet?
       | 
       | Or is it more theory?
        
         | aleph_minus_one wrote:
         | > Would it be possible to hack the management engine in such a
         | way that during boot it makes an internet connection and
         | imports some logo from the internet?
         | 
         | This rather sounds like something that one could implement as
         | an UEFI application.
        
         | krallja wrote:
         | That sounds like PXE booting with one more step
        
       | pragma_x wrote:
       | mov ax,0x0013 ; VGA 320x200x256 colors mode.             int 0x10
       | ; Set video mode.
       | 
       | Oh man that takes me back. Also this is sporting a fixed-point
       | sin table and compiled down to a .com. It's like 1994 all over
       | again.
        
         | pk-protect-ai wrote:
         | I had repeating dreams about int 10h and EGA back in 1991 ...
         | It was magic ...
        
         | sitzkrieg wrote:
         | mode 13h gfx programming in tasm well after its heyday was my
         | first programming really (i was young and stumbled) fond
         | memories
        
       | alexshendi wrote:
       | No way to define procedures and no list processing? Hardly LOGO.
        
         | alexshendi wrote:
         | But still impressive. I will see, if I can massage Justine
         | Tunney's sectorlisp into something resembling a (subset of)
         | LOGO, probably w/o turtle graphics. Deliverable will probably
         | be a DOS COM-file rather than a boot sector.
        
       | userbinator wrote:
       | It's 508 bytes, much better than what a compiler can do, and yet
       | from a quick glance at the source I can still find a few more
       | bytes to squeeze out.
        
         | zoky wrote:
         | Oh? Do tell.
        
           | userbinator wrote:
           | Looks like some of the other comments here have found a few
           | of the optimisations already, but another one is that BIOS
           | functions don't change register values unless specifically
           | used for output --- in HLL jargon, all registers are
           | effectively callee-save. Thus no need to e.g. use 16-bit move
           | immediate when an 8-bit would be sufficient due to the other
           | half already having the right value.
        
       | karuvally wrote:
       | This look so refreshing OP! Will try to make some changes and
       | have fun!
        
       | jcmeyrignac wrote:
       | The jb .5 can be removed, saving 2 bytes. There are other
       | optimizations, like inc di/jmp short avoid_command which could be
       | moved before avoid_command, saving another 2 bytes.
        
         | nanochess wrote:
         | Thanks for the tips! I've updated bootLogo and mentioned you in
         | the manual. Now bootLogo has PU/PD commands.
        
       | anthk wrote:
       | Thtat reminds me that when I was a kid and I knew literally
       | nothing about computers, I hated Logo because of a totally non-
       | intuitive syntax, but I solved a math puzzle (something like the
       | mpuz form Emacs, but for DOS PC's) at great speeds. With Windows
       | 96/98 and C++ it was even worse, as the programming barrier was
       | uber-high with the Win32 API, and most of sysadmin the stuff
       | under Windows was MS's technobabbled nonsense.
       | 
       | Thus, I tought computers where a crappy blackbox for College
       | engineers and with no open knowledge. Until early 00's.
       | 
       | Then GNU/Linux came, with full manuals included for _everything_
       | with Debian Woody and then Sarge. I tried to do the same with
       | PostScript, it 's kinda the literal same thing as Logo, but now
       | the environment was much saner and understandable, with Emacs
       | calling GV on demand, and the most importang thing:
       | documentation. As simple was that. Bundled help files.
       | 
       | You didn't require books not found anywhere else, nor an internet
       | connection, nor people really far from your blue collar relatives
       | who had no connection to computers. The gap between the nerdy kid
       | with young parents around computers and me became much smaller,
       | and the GNU/BSD guys did an oustanding work spreading IT to
       | anyone.
        
       | qgin wrote:
       | This makes me so happy. Logo on the Apple IIe was my first
       | exposure to programming ever as a kid.
        
       | dloss wrote:
       | Made by Oscar Toledo G., who learned assembly language by age 9
       | and won the International Obfuscated C Contest five times.
       | 
       | https://nanochess.org/author.html
        
         | jpablo wrote:
         | Is he related to the infamous Familia Toledo
         | http://www.biyubi.com/?
        
           | slumberdisrupt wrote:
           | Yes, one and the same (he appears on the homepage you linked)
        
       | fsmv wrote:
       | Hello friend. I'm on a crusade to make people's bootsector code
       | work on real hardware.
       | 
       | You're missing several reserved memory areas and state bits to
       | reset. Check out my bootsector I have lots of comments on what
       | things are needed https://github.com/fsmv/bootstrap-
       | os/blob/master/bootloader/...
       | 
       | You can probably drop the extra sector loading code and error
       | printing and only use the header and footer.
        
         | ikari_pl wrote:
         | This is a crazy comment to find. I LOVE IT.
        
       | mapreduce wrote:
       | Like others have said this is hardly Logo.
       | 
       | Turtle graphics != Logo.
       | 
       | Turtle graphics is a tiny tiny subset of Logo.
       | 
       | But let us not miss the forest for the trees. It is still very
       | impressive that the tiny tiny subset of Logo fits in 508 bytes of
       | machine code.
        
       | parkertomatoes wrote:
       | I remember copying logo programs from a whiteboard into an Apple
       | II as a grade schooler. It's a great "instant results" way to
       | introduce kids to programming, and it lends itself to exploration
       | in a way that today's copycats ($10/mo iPad subscriptions and
       | visio diagrams to make a character walk around) don't.
       | 
       | Browser emulator link:
       | https://parkertomatoes.github.io/v86/?type=mbr&content=%2FLg...
        
       ___________________________________________________________________
       (page generated 2024-03-19 23:00 UTC)