Hacker Newsnew | past | comments | ask | show | jobs | submit | nithinbekal's commentslogin

I've been having a lot of fun building my own programming language [1]. Getting to the point where you can write programs in your own language was surprisingly easy.

The language, Sapphire, is Ruby inspired, so the most interesting part is digging into the internals of the latter when I'm trying to figure out how something should work.

[1] https://github.com/sapphire-project/sapphire


A Ruby-inspired typed programming language called Sapphire: https://github.com/sapphire-project/sapphire

I was reading the fantastic Crafting Interpreters book, and been wondering what it would be like to design a language from scratch. I really enjoy using Sorbet with Ruby, so wanted to design a small language with Ruby's object model, and a gradual type system.

Despite not knowing much programming language theory, I was able to make a surprising amount of progress over a couple of weekends using Claude Code, including building a simple version manager for the language - https://github.com/sapphire-project/facet


Blog: https://nithinbekal.com/

Photography: https://photos.nithinbekal.com/

Directory of free technical books: https://devlibrary.org/


Beautiful photos.


Thank you!


> Four hundred and sixty books is not a scale problem. Knowing when to delete working code is not something an AI can decide for you.

This is such a key thing I remind myself when I build apps like this for myself. I have a similar app that has a page with 900-odd ratings, and another with 550 owned books. I decided that I won't bother with infinite scroll or complex search and filtering until my browser can no longer handle rendering that data. "Find in page" works well enough for me for now.


Sorbet now supports inline RBS signatures, which I find a lot more readable. If you use VS code with Ruby LSP, the syntax highlighting is pretty great for the signatures too.

https://sorbet.org/docs/rbs-support


I replaced it with a tiny app that I built for myself, that just has the features of Pocket that I was using.

https://bukmark.me/


Wouldn't that be too similar to NoMethodError? I recently came across the idiom in Smalltalk, where you would call subclassResponsibility:

    someMethod:
      self subclassResponsibility
I've suggested the name in the ruby bug tracker issue here:

https://bugs.ruby-lang.org/issues/18915


linguistically speaking, no method means the name isn’t even known, which isn’t the case here. the name exists and is known (after a successful declaration). what’s missing is the actual definition. if we lean heavily into language, perhaps only undefined method will do.


That's from 6 years ago. Shopify has used Rails' main branch since 2019.

https://shopify.engineering/living-on-the-edge-of-rails


While this was true for a long time, Ruby's built in irb and debug gems have improved dramatically in the past couple of years. To the point that I've switched to them from pry+byebug that I've been using for years.


One advantage of byebug is that if you do a sleep in something with theeads like capybara tests, the browser becomes functional again. Which is not the case with irb/debug. I couldn't find a way to reproduce this behavior in recent debuggers.


Can you do things like `next`, `step`, `up` or `caller` to go up/down the callstack like you can with pry?


Yes, you can with irb:debug, which you can enter by typing debug one you're inside a binding.irb session.


There are plans to introduce type system into Elixir:

https://elixir-lang.org/blog/2023/06/22/type-system-updates-...


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: