5 ms·
Ink programming language
- thesephist 5y agoHey HN, OP here. Ink isn't really anywhere near in a shape for any kind of "public" or "production" use. It was a toy programming language I built to (1) learn how interpreters worked and (2) build some side projects of mine, back in 2019. Since then it's grown steadily to allow me to build more complex full-stack apps, like Monocle[0]. But the truth is many parts of the language are still rough and mostly meant for personal use. So I guess what I'm saying is — please be gentle, and hopefully there are some interesting ideas in there, or at the very least, it inspires someone else to go build toy languages of their own. If you're curious about the personal history of the project, Ink was the subject of a recent talk I gave at GopherCon EU[1] [0] https://github.com/thesephist/monocle https://github.com/thesephist/monocle [1] https://youtu.be/nNQHw_RdXvg https://youtu.be/nNQHw_RdXvg EDIT: If any mod is reading, the language is called "Ink" not "dot ink", though the domain is confusing. If the title could be modified that would be... swell.
- stoicjumbotron 5y agomonocle is insane! The results were blazing fast when I searched on your site: https://monocle.surge.sh https://monocle.surge.sh
- thesephist 5y agoIt's funny that lots of people comment on the snappy UI, because there isn't actually a lot of performance magic going on here -- the frontend just loads a few-MB large gzipped JSON inverted index and uses it to do all search and display locally in the browser using pretty normal unoptimized JavaScript. No WebAssembly or anything else fancy -- just JavaScript working through a large object graph. I think in general simple JavaScript applications can be remarkably fast these days if you're careful not to introduce unnecessary work and aware of the data structures you're using and profile + optimize judiciously :)
- RodgerTheGreat 5y ago"dot ink" might be better, given the name clash with Inkle Studios' interactive fiction language: https://www.inklestudios.com/ink/ https://www.inklestudios.com/ink/
- Torwald 5y agothere is also the DOT language for schematics from AT&T
- creativeembassy 5y agoYeah, came here expecting to hear about an update from Inkle Studios. (I checked them out anyway since Heaven’s Vault is one of the most kind-blowing games I’ve ever played, and they do have a new game out! Their ink language is worth a look.)
- Applejinx 5y agoI made the same mistake. I've been aware of Inkle Studios' work for some time now, and I thought it was an article on new developments in that.
- Kinrany 5y agoThere's also Parity's "ink!" for writing smart contracts: https://github.com/paritytech/ink https://github.com/paritytech/ink
- benjaminjosephw 5y agoThis is such a beautifully designed language. I came across Ink a few months ago and I was delighted with how small and concise it is. I can see this being a very interesting teaching language but it's also good to see that it has real life deployments too. Any thoughts about growing this beyond a personal project?
- thesephist 5y agoInk in its current form/design has a few fatal flaws, mostly around poorly conceived syntax and semantics. I didn't notice it in design because I was new to designing a PL, but noticed them as I wrote a lot of software in Ink. These are pretty fundamental to the language so re-doing them would constitute a hugely breaking version change, but those changes are necessary I think for me to be confident telling other people to try it and use it. Some of these "flaws" I found are: - I want real lists/arrays rather than Lua table-style data structures - I need either pipelines (->>, |>) or class-style methods for ergonomics - Testing and module system stories need a lot of work. - Syntax quirks makes some kinds of nice constructs syntactically impossible or verbose (e.g. calling a fn defined on an object requires parenthesis to override the default order of operations) I recently started hacking on a sort of "Ink 2.0" that preserves a lot of what I like about Ink (minimalism, lispy-ness, value rather than reference types, match expressions) without many of the design flaws. I might share and push that more publicly once I feel it's getting ready.
- skoodge 5y agoVery, very impressive. I just spent the last hour going down the rabbit hole of reading your blog and browsing through your different side projects (which I can only recommend to fellow HN readers, the programming language posted here really is just the tip of the iceberg). Creating your own programming language is remarkable in its own right, but then using it to build your own frontend & backend frameworks, search engine, productivity suite, 3D renderer and a bunch of other apps ist just impressive on another level. What I find most fascinating about your side projects is how you bring together a number of different skills in a way that looks almost effortless. Knocking out a search engine or a twitter reader as a throwaway learning project is one thing, but doing it over the course of little more than a week with a well designed UI in a way that ends up being useful in your own workflows? That not only takes some serious work but also the ability to correctly judge which directions not to go in, which can be one of the hardest aspects of developing software.
- thesephist 5y agoThanks! This comment made my day. Certainly knowing which directions not to go in is a big part of my efficiency, and something I'll point to whenever I get asked that question in the future.
- thih9 5y agoMods please change title to “Ink programming language” (currently says “Dot Ink...”). The language is called “Ink”; “dotink” is just the domain name. As also mentioned in the author’s comment: https://news.ycombinator.com/item?id=27798704 https://news.ycombinator.com/item?id=27798704 .
- pknerd 5y agoSorry for the off-topic but can someone guide me about the roadmap/resource how one can make a toy/hobby language(even an intepretator language)? I might like to give it a try either in Python or Go and it could be a good excuse to refresh my compiler/language course I took 23 years back
- Avi-D-coder 5y agohttps://craftinginterpreters.com/ https://craftinginterpreters.com/ If your in the mood to learn Haskell: http://dev.stephendiehl.com/fun/ http://dev.stephendiehl.com/fun/ https://jktkops.github.io/Write-You-a-Haskell-2/ https://jktkops.github.io/Write-You-a-Haskell-2/
- codewithcheese 5y agoImplementing a Webassembly interpreter in python for fun: https://youtu.be/r-A78RgMhZU https://youtu.be/r-A78RgMhZU
- Banana699 5y agoThere is a pair of books called "writing an interpreter in Go" and "writing a compiler in Go" If I remember their names, pretty accessible. There is also the outstanding "Crafting Interpreters" by Robert Nystrom, this book and its author hold a very special place in my heart. Before I read this book I was stuck at the "+-*/ calculator" level in compilers and interpreters, intimidated by the depth and breadth of further material. This book teaches you how to make a full blown scripting language with first class closures and classes, first as an interpreter running on java (high level enough to get the intimidated beginner started and focused on the task, yet still a challenging learning experience) then as a {bytecode compiler, VM} pair in C be because this is how all the cool kids write their interpreters and compilers. Accessible if there was ever such a thing in the world, I mean it : if you understand how linked lists, hash maps and trees work, you're good to go. The icing on the cake is that the whole thing is free on a website by the same name the author made, the same thing he did with his other book about Game Programming Design Patterns, it's an astonishing act of charity, I really wish to meet this guy. An awesome personality and a great teacher. You will remember his voice and manner of speech for a lot of time. There is also the book "elements of computing systems" aka "From Nand To Tetris", where the authors walk you through creating a full computing stack from the NAND logic gate to the OS. Starting from chapter 6 through 11, you write an assembler for the hardware, then implement a VM running on the assembler, then implement a java-like language on top of the VM. These things are just off the top of my head, there is a massive trove of material in YouTube and the rest of the Internet.
- flakiness 5y agoFor someone who care the implementation than the high-level design: It's written in go, interpreter-based, and pretty small [1]. Although the author seems to be a well-studied PL lover, you don't have to be like this to create a small language. It's fun experience and there are books for non-experts like [3]. - [1] https://github.com/thesephist/ink/tree/master/pkg/ink https://github.com/thesephist/ink/tree/master/pkg/ink - [2] https://thesephist.com/posts/pl/ https://thesephist.com/posts/pl/ - [3] https://interpreterbook.com/ https://interpreterbook.com/
- macintux 5y agoAlso: http://craftinginterpreters.com/ http://craftinginterpreters.com/
- thesephist 5y ago+1 to both Crafting Interpreters, which is probably my favorite free online text about this stuff, as well as the Interpreter Book and Compiler Book, both written for Go as the implementation language. They were all a huge help for me learning the ropes initially.
- johnisgood 5y agoYeah, when I looked at the code I was like: "it's just like Go".
- all2 5y ago@thesephist, I have friends in West Lafayette. If you'd like I'll buy you a cup of coffee when I'm over that way!
- thesephist 5y agoI'm usually in NYC these days, but WL is my hometown. Appreciate the offer! Maybe we'll meet up in NY instead :)
- premek 5y agoThere is another ink language https://www.inklestudios.com/ink/ https://www.inklestudios.com/ink/