[{"data":1,"prerenderedAt":301},["ShallowReactive",2],{"project-11948955":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":34,"aspects":35,"strip":39,"post_text":41,"what":42,"said":57,"maker_in_thread":110,"shape":122,"grid":127,"attempts":263,"same_week":264,"maker_shows":250,"maker_hidden":293,"reader_version":294,"card":295},"11948955","huo","Writing my first interpreter in C for fun","title","Show HN: Writing my first interpreter in C for fun","https:\u002F\u002Fgithub.com\u002Fincrediblesound\u002Fhuo","github.com","jhedwards",1466539139,2016,109,52,337,2264,15,"notable","languages","interpreter","cli",[21,24,25,26,27],"c language","toy language","lexer parser","recursive descent","loved",0.333,{"positive":31,"neutral":32,"mixed":33,"critical":33},4,3,0,7,{"design":36,"execution":38},{"positive":37,"critical":33},1,{"positive":37,"critical":33},[33,33,33,40,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,32,32,33,33,40,40,40,32],5,null,{"problem":41,"audience":41,"pricing":41,"motivation":43,"time_to_build":41,"stack":49,"openness":54,"stage":55,"team_size":56},{"value":44,"source":45,"evidence":46},"Built for fun as a first interpreter.","maker",[47],{"id":48},"post",[50],{"value":51,"source":45,"evidence":52},"C",[53],{"id":48},"open_source","unknown","solo",{"praise":58,"objections":74,"requests":75,"questions":90,"alternatives":95},[59,67],{"value":60,"source":61,"evidence":62},"Readable, clean code structure","commenter",[63],{"id":64,"by":65,"text":66},"11953733","stevekemp","That's a nice set of readable code. I made a minor change just to add in floats instead of ints, which wasn't too hard to accomplish thanks to your structure. (Though my changes…",{"value":68,"source":61,"evidence":69},"Good learning project",[70],{"id":71,"by":72,"text":73},"11949067","Dangeranger","Hey this is great work! What resources would you recommend for someone else who wants to build their own toy language for fun and practice?",[],[76,83],{"value":77,"source":61,"evidence":78},"Add a REPL",[79],{"id":80,"by":81,"text":82},"11951091","analog31","Nice work. What would take, to make it into a REPL? I haven't looked closely at the code yet, so maybe it's close to being there.",{"value":84,"source":61,"evidence":85},"Add bytecode execution instead of AST walking",[86],{"id":87,"by":88,"text":89},"11950132","sdegutis","Nice! If you're looking for another fun challenge, make your language compile into bytecode and execute that instead of an AST. :)",[91],{"value":92,"source":61,"evidence":93},"What resources help build a toy language?",[94],{"id":71,"by":72,"text":73},[96,103],{"value":97,"source":61,"evidence":98},"Build Your Own Lisp",[99],{"id":100,"by":101,"text":102},"11952104","Nr7","http:\u002F\u002Fwww.buildyourownlisp.com\u002F",{"value":104,"source":61,"evidence":105},"Peter Norvig's Lisp interpreters",[106],{"id":107,"by":108,"text":109},"11949691","bertr4nd","I highly recommend Peter Norvig's example Lisp interpreters. He has Python and Java implementations and they are both very accessible, so you can digest them in a few hours'…",{"comments":32,"answered":111,"key":112},2,[113,116,119],{"id":114,"text":115},"11949122","Thank you! I've seen a lot of great articles and tutorials on HN about this subject, so you can probably find a lot of good resources doing a search here. To start I can link you…",{"id":117,"text":118},"11954671","I just realized reading your comment that I did implement functions but I forgot to document them! I will update the readme immediately. If you look in the main file, huo.c, you…",{"id":120,"text":121},"11951759","That's a good idea. I don't think it would be hard, you just get the interpreter to run in a loop and read from the keyboard input. I'll put that on the list for upcoming…",{"commenters":123,"max_depth":124,"maker_replies":32,"first_comment_mins":125,"lifespan_hours":126},36,8,18,167,[128,132,136,139,141,143,145,148,151,154,157,160,163,165,168,171,173,176,178,180,183,187,190,191,194,197,199,201,203,206,209,210,213,216,219,222,225,228,230,232,234,236,240,241,244,247,249,252,254,257,260,261],[129,33,33,130,131,33],"11953851","other\u002Fneutral\u002Fdocs","naveen99",[133,33,33,134,135,33],"11956611","commenter\u002Fneutral\u002Fnone","Flow",[137,33,33,134,138,33],"11957031","segmondy",[140,33,33,134,131,33],"11960571",[71,37,40,142,72,33],"project\u002Fpositive\u002Fnone",[114,37,33,144,11,37],"maker\u002Fneutral\u002Fdocs",[146,37,33,134,147,33],"11949212","cel1ne",[149,37,33,134,150,33],"11949314","zzzcpan",[152,37,33,134,153,33],"11951286","textmode",[155,37,33,134,156,33],"11951565","tptacek",[158,37,33,134,159,33],"11952258","groovy2shoes",[161,37,33,134,162,33],"11952652","sklogic",[164,37,33,134,159,33],"11996429",[166,37,33,134,167,33],"11952011","pjmlp",[169,37,33,134,170,33],"11952245","91891879181",[172,37,33,134,159,33],"11952273",[174,37,33,134,175,33],"11952344","99189198191",[177,37,33,134,162,33],"11952486",[179,37,33,134,167,33],"11952944",[181,37,33,134,182,33],"11949626","0x07c0",[184,37,33,185,186,33],"11949270","other\u002Fneutral\u002Fnone","DanWaterworth",[188,37,33,185,189,33],"11949514","brettlangdon",[107,37,33,185,108,33],[192,37,33,185,193,33],"11950088","GregBuchholz",[195,37,33,134,196,33],"11950184","agumonkey",[198,37,33,134,193,33],"11950999",[200,37,33,185,138,33],"11957068",[202,37,33,134,196,33],"11957633",[204,37,33,134,205,33],"11959341","Immortalin",[207,37,33,185,208,33],"11951894","bluetomcat",[100,37,33,185,101,33],[211,37,33,185,212,33],"11952213","reachtarunhere",[214,37,33,185,215,33],"11952844","sleepychu",[217,111,33,185,218,33],"11953457","melling",[220,32,33,185,221,33],"11949127","weberc2",[223,32,33,185,224,33],"11949237","felixangell1024",[226,32,33,185,227,33],"11949502","andars",[229,32,33,185,162,33],"11952460",[231,32,33,185,182,33],"11949290",[233,32,33,185,159,33],"11952271",[235,32,33,185,162,33],"11952449",[237,31,32,238,239,33],"11951245","project\u002Fneutral\u002Fnone","ndesaulniers",[87,40,32,238,88,33],[242,40,33,185,243,33],"11950908","chrisseaton",[245,40,33,185,246,33],"11951945","mungoman2",[248,40,33,185,243,33],"11952660",[64,250,40,251,65,33],6,"project\u002Fpositive\u002Fdesign",[117,250,33,253,11,37],"maker\u002Fneutral\u002Fexecution",[255,250,40,256,65,33],"11954865","maker\u002Fpositive\u002Fexecution",[258,34,40,142,259,33],"11949706","ckaygusu",[80,124,32,238,81,33],[120,124,33,262,11,37],"maker\u002Fneutral\u002Fnone",[],[265,270,274,279,284,288],{"id":266,"name":267,"points":268,"category":269},"11950664","u2f-zero",267,"security_privacy",{"id":271,"name":272,"points":273,"category":20},"11938405","fortran-machine",227,{"id":275,"name":276,"points":277,"category":278},"11918459","Trigger",164,"finance_crypto",{"id":280,"name":281,"points":282,"category":283},"11947044","80,000 Hours career guide",93,"productivity",{"id":285,"name":286,"points":287,"category":20},"11940173","ViziCities 0.3",89,{"id":289,"name":290,"points":291,"category":292},"11916321","facebook-page-post-scraper",75,"data",false,"v2",{"id":296,"name":5,"line":6,"ai":293,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":297,"top":18,"kw":298,"maker":11,"domain":10,"tier":19,"attempts":33,"strip":299,"url":9,"mix":300,"praise":60,"objection":-1,"sub":21},11948955,0.33,[21,24,25,26,27],"0005000000000000000000000000000033005553",[31,32,33,33],1794036545279]