[{"data":1,"prerenderedAt":525},["ShallowReactive",2],{"project-17294548":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":35,"aspects":36,"strip":40,"post_text":45,"what":46,"said":75,"maker_in_thread":165,"shape":173,"grid":177,"attempts":487,"same_week":488,"maker_shows":34,"maker_hidden":517,"reader_version":518,"card":519},"17294548","Fo","An experimental language which adds generics on top of Go","title","Show HN: Fo: An experimental language which adds generics on top of Go","https:\u002F\u002Fgithub.com\u002Falbrow\u002Ffo","github.com","polymathist",1528819126,2018,165,124,236,2155,11,"notable","languages","programming language","other",[24,25,26,27],"go generics","compile to go","transpiler","generic types","curious",0.089,{"positive":31,"neutral":32,"mixed":33,"critical":34},6,30,0,2,38,{"idea":37,"design":38,"execution":39},{"positive":34,"critical":34},{"positive":34,"critical":33},{"positive":33,"critical":33},[41,33,33,33,41,42,42,42,42,42,42,41,41,42,33,33,33,33,33,33,33,33,33,33,33,33,41,42,42,34,33,42,42,43,33,33,42,44,33,33],5,3,4,1,null,{"problem":47,"audience":45,"pricing":45,"motivation":45,"time_to_build":55,"stack":62,"openness":74,"stage":74,"team_size":74},{"value":48,"source":49,"evidence":50},"Go lacks generics","commenter",[51],{"id":52,"by":53,"text":54},"17296137","gtt","I liked certain aspects of Go, but lack of generics was a deal-breaker for me. You approached it a way better than I (and many others) did. Instead of arguing on forums you…",{"value":56,"source":57,"evidence":58},"Worked on part time for 4 months","maker",[59],{"id":60,"by":11,"text":61},"17294576","Author here. I've been working on Fo part time for 4 months. Feel free to ask me anything.",[63],{"value":64,"source":49,"evidence":65},"Go",[66,70],{"id":67,"by":68,"text":69},"17295693","zokier","It seems to compile (\"transpile\") to Go, and then invoke Go compiler on the generated source. So I guess that would make it also binary compatible?…",{"id":71,"by":72,"text":73},"17295774","stansm","Briefly looking at source one can tell it just transforms Fo into Go and invokes go run","unknown",{"praise":76,"objections":85,"requests":107,"questions":132,"alternatives":149},[77],{"value":78,"source":49,"evidence":79},"Cool approach; author started writing code instead of arguing",[80,81],{"id":52,"by":53,"text":54},{"id":82,"by":83,"text":84},"17296268","weberc2","This is suuuper cool. I've thought of doing something similar for a while, but I tried approaching it from the \"generate Go\" angle. I also found the Go syntax too tedious to…",[86,92],{"value":87,"source":57,"evidence":88},"Generic interfaces not yet supported",[89],{"id":90,"by":11,"text":91},"17305286","The Fo compiler parses and type-checks Fo source code and then generates and outputs Go code. It generates a unique concrete type for each usage of a generic type. You can look…",{"value":93,"source":49,"evidence":94},"Go already has generics or they are unnecessary",[95,99,103],{"id":96,"by":97,"text":98},"17296177","jcelerier","but go already has generics https:\u002F\u002Fwww.reddit.com\u002Fr\u002Frust\u002Fcomments\u002F5penft\u002Fparallelizing_enjarify_in_go_and_rust\u002F",{"id":100,"by":101,"text":102},"17298119","symlock","The only time I find I need generics is when I'm prototyping things and making lots of changes. Node, Ruby, & Python are great for this. In fact, PHP's associative array is…",{"id":104,"by":105,"text":106},"17298191","marcrosoft","I've been working full time in Go since 2012. I've never had a use for generics.",[108,119,125],{"value":109,"source":49,"evidence":110},"Bounded type constraints",[111,115],{"id":112,"by":113,"text":114},"17297993","gliese1337","Is there any support for bounded type variables? Or plans to add them?",{"id":116,"by":117,"text":118},"17297826","leshow","Can you do ad-hoc or bounded polymorphism? What about recursive types?",{"value":120,"source":49,"evidence":121},"Sum types",[122],{"id":123,"by":83,"text":124},"17296299","Any plans to add formal sum types (as opposed to interface hacks)?",{"value":126,"source":49,"evidence":127},"Import support",[128],{"id":129,"by":130,"text":131},"17296510","nemo1618","Hi there! I worked on something similar a while ago: a compile-to-Go superset that adds some generic functions\u002Fmethods. You may have come across it:…",[133,141],{"value":134,"source":49,"evidence":135},"How are recursive and self-referencing types handled",[136,140],{"id":137,"by":138,"text":139},"17295665","kodablah","For generics: How do recursive types and self-referencing types work? What about generic types that themselves require generic types? Can type constraints be applied? What do…",{"id":116,"by":117,"text":118},{"value":142,"source":49,"evidence":143},"Is the output monomorphized",[144,148],{"id":145,"by":146,"text":147},"17295858","webkike","It's very likely monomorphizing the types, i.e. creating a unique type for each generic invocation.",{"id":90,"by":11,"text":91},[150,154,161],{"value":151,"source":49,"evidence":152},"Ply",[153],{"id":129,"by":130,"text":131},{"value":155,"source":49,"evidence":156},"gotemplate",[157],{"id":158,"by":159,"text":160},"17301902","nickcw","I think parameterized packages are a great idea. It would be a light-weight way of getting just a bit of generic code into go. I made gotemplate to explore that idea…",{"value":162,"source":49,"evidence":163},"Oden",[164],{"id":137,"by":138,"text":139},{"comments":166,"answered":31,"key":167},7,[168,169,170],{"id":60,"text":61},{"id":90,"text":91},{"id":171,"text":172},"17305299","Definitely something I'm thinking about. It's one of a handful of features that I have in my head but haven't created an issue for.",{"commenters":174,"max_depth":175,"maker_replies":166,"first_comment_mins":34,"lifespan_hours":176},71,9,102,[178,180,184,187,190,193,196,199,202,204,207,210,213,216,219,223,225,227,231,234,235,236,239,240,241,243,244,246,247,249,253,256,259,262,264,266,268,270,272,274,275,277,279,282,284,287,289,292,295,296,297,300,303,305,308,310,312,315,317,320,322,324,326,329,331,334,337,339,342,344,346,348,350,352,354,356,358,361,363,367,369,371,373,376,378,382,385,388,391,394,396,399,402,405,408,410,412,414,417,420,422,425,428,430,434,438,441,444,446,448,451,453,456,458,461,463,466,468,470,473,475,477,481,484],[52,33,41,179,53,33],"maker\u002Fpositive\u002Fidea",[181,33,33,182,183,33],"17296685","commenter\u002Fneutral\u002Fnone","awb",[185,33,33,182,186,33],"17296762","gowld",[188,33,33,182,189,33],"17297634","mirkoadari",[191,33,33,182,192,33],"17305360","tree_of_item",[194,33,33,182,195,33],"17296769","ajkjk",[197,33,33,182,198,33],"17296778","andrewstuart2",[200,33,33,182,201,33],"17296813","thanatos_dem",[203,33,33,182,83,33],"17298866",[205,33,33,182,206,33],"17296858","cowboysauce",[208,33,33,182,209,33],"17297164","jj2",[211,33,33,182,212,33],"17297416","pionar",[214,33,33,182,215,33],"17297719","eropple",[217,33,33,182,218,33],"17302765","tapirl",[220,33,41,221,222,33],"17306558","maker\u002Fpositive\u002Fnone","oweiler",[137,44,42,224,138,33],"project\u002Fneutral\u002Fdesign",[60,34,33,226,11,44],"maker\u002Fneutral\u002Fnone",[228,34,42,229,230,33],"17295569","project\u002Fneutral\u002Fexecution","politician",[232,34,42,229,233,33],"17295821","deckar01",[145,34,42,229,146,33],[90,34,33,229,11,44],[237,34,42,229,238,33],"17295642","Analemma_",[67,34,42,229,68,33],[71,34,42,229,72,33],[123,34,42,242,83,33],"project\u002Fneutral\u002Fidea",[171,34,33,242,11,44],[245,34,42,226,83,33],"17305605",[129,34,42,224,130,33],[248,34,33,229,11,44],"17305222",[250,34,33,251,252,33],"17296577","other\u002Fneutral\u002Fnone","tclancy",[254,34,33,251,255,33],"17296746","mustaflex",[257,34,42,224,258,33],"17296898","bakul",[260,34,42,224,261,33],"17296968","pjmlp",[263,34,42,224,83,33],"17300084",[265,34,33,182,261,33],"17300336",[267,34,42,224,258,33],"17301039",[158,34,41,269,159,33],"project\u002Fpositive\u002Fdesign",[271,34,33,224,11,44],"17305253",[273,34,41,269,258,33],"17305940",[116,34,42,242,117,33],[276,34,33,242,11,44],"17305563",[278,34,42,229,117,33],"17329652",[280,42,33,251,281,33],"17297610","jstimpfle",[283,42,33,251,261,33],"17297780",[285,42,33,251,286,33],"17298328","ben509",[288,42,33,251,281,33],"17298896",[290,42,33,251,291,33],"17302533","jhomedall",[293,42,33,182,294,33],"17298364","mkehrt",[100,43,33,251,101,33],[104,43,33,251,105,33],[298,43,33,251,299,33],"17298269","jimbokun",[301,43,33,251,302,33],"17299027","skj",[304,43,33,251,261,33],"17300365",[306,43,33,251,307,33],"17298289","jjoonathan",[309,43,33,251,105,33],"17298311",[311,43,33,182,307,33],"17298470",[313,43,33,251,314,33],"17298313","anonymoushn",[316,43,33,251,307,33],"17298360",[318,43,33,182,319,33],"17298509","ckocagil",[321,43,33,182,302,33],"17299022",[323,43,33,182,307,33],"17299125",[325,43,33,182,101,33],"17298316",[327,43,33,328,307,33],"17298410","commenter\u002Fneutral\u002Fidea",[330,43,33,182,314,33],"17298296",[332,43,33,328,333,33],"17298462","ereyes01",[335,43,33,336,314,33],"17298516","commenter\u002Fneutral\u002Fperformance",[338,43,33,336,333,33],"17298737",[340,43,33,336,341,33],"17299482","burntsushi",[343,43,33,336,83,33],"17300113",[345,43,33,182,341,33],"17301979",[347,43,33,182,261,33],"17300351",[349,43,33,328,258,33],"17298310",[351,43,33,182,105,33],"17298350",[353,43,33,328,294,33],"17298439",[355,43,33,328,258,33],"17298981",[357,43,33,182,341,33],"17299497",[359,43,33,328,360,33],"17298413","atombender",[362,43,33,182,105,33],"17298432",[364,41,33,365,366,33],"17297935","other\u002Fneutral\u002Fidea","dagss",[368,41,33,365,138,33],"17298210",[82,31,41,370,83,33],"project\u002Fpositive\u002Fidea",[372,31,33,182,130,33],"17296594",[374,31,33,182,375,33],"17296831","pravj",[377,31,33,182,83,33],"17297865",[379,166,42,380,381,33],"17295686","project\u002Fneutral\u002Fnone","bigato",[383,166,42,380,384,33],"17296477","tunesmith",[386,166,42,380,387,33],"17297143","munificent",[389,166,42,380,390,33],"17297170","ithkuil",[392,166,42,380,393,33],"17297154","spraak",[395,166,42,380,281,33],"17297551",[397,166,42,380,398,33],"17297823","vorg",[96,400,44,401,97,33],8,"project\u002Fcritical\u002Fidea",[403,400,33,182,404,33],"17296303","tomp",[406,400,33,182,407,33],"17296494","reificator",[409,400,33,182,130,33],"17296563",[411,400,33,182,407,33],"17296794",[413,400,33,328,404,33],"17303821",[415,175,42,242,416,33],"17295594","sagichmal",[418,175,42,224,419,33],"17296276","en4bz",[112,421,42,224,113,33],10,[423,421,33,424,11,44],"17305585","maker\u002Fneutral\u002Fdesign",[426,18,42,380,427,33],"17298110","jeffrallen",[429,18,42,380,261,33],"17300377",[431,432,41,221,433,33],"17298104",12,"stunt",[435,436,42,242,437,33],"17296055",13,"tonyedgecombe",[439,436,33,182,440,33],"17296257","jitl",[442,436,33,182,443,33],"17296373","bb88",[445,436,33,182,390,33],"17297288",[447,436,33,182,443,33],"17307303",[449,436,33,182,450,33],"17296890","IshKebab",[452,436,33,182,398,33],"17297808",[454,436,42,242,455,33],"17296273","oldgun",[457,436,33,328,407,33],"17296648",[459,436,33,182,460,33],"17296763","gnode",[462,436,33,182,407,33],"17296837",[464,436,44,401,465,33],"17296897","HeyImAlex",[467,436,33,182,407,33],"17296922",[469,436,33,182,465,33],"17297127",[471,436,33,328,472,33],"17298145","iainmerrick",[474,436,33,328,407,33],"17298336",[476,436,33,182,472,33],"17298954",[478,479,33,251,480,33],"17295770",14,"gggguil",[482,479,33,251,483,33],"17296324","jrs95",[485,479,33,251,486,33],"17298266","kchr",[],[489,494,498,503,507,512],{"id":490,"name":491,"points":492,"category":493},"17286770","Ancient Earth",384,"learning_science",{"id":495,"name":496,"points":497,"category":493},"17272516","Scaler (grunfy)",277,{"id":499,"name":500,"points":501,"category":502},"17291269","Dilay",227,"creative",{"id":504,"name":505,"points":506,"category":20},"17255418","µFSM",154,{"id":508,"name":509,"points":510,"category":511},"17289801","T2b",117,"dev_tools",{"id":513,"name":514,"points":515,"category":516},"17254212","tor-controller",113,"infrastructure",false,"v2",{"id":520,"name":5,"line":6,"ai":517,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":521,"top":18,"kw":522,"maker":11,"domain":10,"tier":19,"attempts":33,"strip":523,"url":9,"mix":524,"praise":78,"objection":87,"sub":21},17294548,0.09,[24,25,26,27],"5000533333355300000000000053320334003100",[31,32,33,34],1794036566884]