HNHacker News
TopNewBestAskShowJobs

nithinbekal

480 karma · joined December 17, 2010

Blog: https://nithinbekal.com/

Github: https://github.com/nithinbekal

submissionscomments
nithinbekal··on Making your own programming language is easier than you think (but also harder)
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

nithinbekal··on Ask HN: What Are You Working On? (April 2026)
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

nithinbekal··on Ask HN: Share your personal website
Thank you!
nithinbekal··on Ask HN: Share your personal website
Blog: https://nithinbekal.com/

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

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

nithinbekal··on Show HN: Vibe coding a bookshelf with Claude Code
> 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.

nithinbekal··on Do I not like Ruby anymore? (2024)
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

nithinbekal··on Ask HN: What Pocket alternatives did you move to?
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/

nithinbekal··on Abstract Methods and NotImplementedError in Ruby
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

nithinbekal··on Shopify Ruby on Rails distributed monolith runs 19M queries per second on MySQL
That's from 6 years ago. Shopify has used Rails' main branch since 2019.

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

nithinbekal··on Ruby Tip – Interactive debugging without the need for gems
Yes, you can with irb:debug, which you can enter by typing debug one you're inside a binding.irb session.
nithinbekal··on Ruby Tip – Interactive debugging without the need for gems
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.
nithinbekal··on Unpacking Elixir: Concurrency
There are plans to introduce type system into Elixir:

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

nithinbekal··on Elixir for cynical curmudgeons
> type mismatch errors at runtime that could have been caught at compile time

It's still early, but there are plans to introduce a type system for Elixir:

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

nithinbekal··on LazyVim
A much simpler alternative to this is kickstart.nvim. My approach to customizing my neovim config was to use kickstart as a reference, and slowly add things that I needed.

https://github.com/nvim-lua/kickstart.nvim

nithinbekal··on Nobody cares about your blog
I started writing my blog as a devlog for myself refer to later, and didn't expect anyone else to care. However, it eventually let to a job interview that in turn led to my current job.

The team I joined worked on a Ruby codebase, and there were people with background in other languages, where method visibility worked differently. A short post I wrote [1] was being shared around in the team, and the manager decided to interview me.

Funnily enough, that same post was quoted to me by a colleague during a code review a few months later! So it turned out that it's still working as intended - as a reference for myself. :)

[1] https://nithinbekal.com/posts/ruby-protected-methods/

nithinbekal··on Ask HN: Could you share your personal blog here?
https://nithinbekal.com/

My random notes about programming, primarily about Ruby and Rails.

Built with Jekyll, and hosted on Github pages. Source can be found here:

https://github.com/nithinbekal/nithinbekal.github.io/

nithinbekal··on Humble Book Bundle: Unix
If you prefer downloading the files the good old fashioned way. ;)

In the browser console:

    $('.js-start-download > a').each(function(a, b) {
        console.log($(b).attr('href'))
    })
Paste the URLs in list.txt and run wget on the list:

    wget --content-disposition --trust-server-names -i list.txt
nithinbekal··on What's new in Rails 5?
> there's that nifty source that packages frontend libraries as gems (the name eludes me at the moment).

Are you thinking of Rails Assets?

https://rails-assets.org

nithinbekal··on Ask HN: Most difficult programming language?
If we're considering esoteric languages, Brainfuck would probably win. :)

"Hello World" in Brainfuck:

    ++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
nithinbekal··on Ask HN: Most difficult programming language?
I recently read about BANCstar, and it seems like a good contender. 0-9, comma, minus sign and return are the only legal characters in it, and despite that, it's actually used in serious applications.

http://en.wikipedia.org/wiki/BANCStar_programming_language

Here's an article about it:

https://github.com/jloughry/BANCStar

nithinbekal··on "My images are all upside down"
Oh, sorry, my mistake.

I've been looking around to see if ImageMagick could do rotation without degrading quality. (I'd also asked a question about that elsewhere in this thread.) So I assumed that most devices use something similar even for displaying on the screen. It appears I assumed wrong. :)

I saw your other comment about axis-aligned rotation not being too computationally expensive. In that case, why aren't iPhones doing it by default? Wouldn't their computation power be comparable to that of most of the cameras that rotate the images? Or are cameras better equipped to handle such transformations?

nithinbekal··on "My images are all upside down"
I suppose the device wouldn't bother with lossless rotation when displaying on the screen. When it comes to saving the image, it has to be lossless, which would probably take a lot more computation power.
nithinbekal··on "My images are all upside down"
I ran into the exact same problem a few days ago. Luckily, ImageMagick, which I'm using for processing uploaded images, has an auto-orient [1] option that allows you to do this automatically.

Unfortunately, with JPEG this would cause some loss of quality, so we're probably going to have to keep the original quality image as well as the auto-orient'ed image to display on the site. Has anyone here worked on something similar? Any ideas on a better way to handle this would be extremely helpful.

[1] http://www.imagemagick.org/script/command-line-options.php#a...

nithinbekal··on What's this programming language?
The app depends on highlight.js which currently supports a limited set of languages, and unfortunately, Brainfuck isn't one of them.

http://softwaremaniacs.org/media/soft/highlight/test.html

I wonder what would happen to the accuracy of highlight.js highlightAuto method if more languages were to be supported. Highlight.js recognizes languages based on how many language constructs it can recognize. More languages = more overlap in language constructs, and therefore more likelihood of wrong matches.

nithinbekal··on What's this programming language?
Yup, it does a terrible job with the C family of languages. Hardly ever gets that right. And if you type in any random keys, it often identifies it as Haskell. ;-)

It does a decent job with Perl, Python, Ruby, Bash, etc.

nithinbekal··on What's this programming language?
OP here. I can't take credit for that, though. ;-)

It uses the highlight.js API for making the guesses, which provides the 2nd best option as well. :)

nithinbekal··on Siri’s first real competition hits Android phones today [video]
It's certainly not a common name, if even that. I'm Indian, and have never heard of someone called siri. "Shri" is often a part of longer names, though it's almost never used in isolation (I can't recall anyone whose first name was simply Shri), because it is also a word used in the same sense as "Mr." in English.

As for being a word in South Indian languages... it's possible that it's an archaic word, but it's certainly not used commonly, at least in Kannada (which is my first language).

Anyway, my point is that it shouldn't have been there in the wikipedia page as a "common Hindu name", but I should probably be discussing this on the wiki talk page rather than HN. ;-)

nithinbekal··on "I've isolated the bug to a database query"
I was just trying to figure out a stored procedure that queries one table, loops over the rows, and within the loop queries another table using the values from the first query. Now, looping over these rows, it has a third query and a corresponding loop over those rows.

And all that for inserting the values taken from the three tables into a 4th table. This could have been done with a simple 3-table join query. Hell, it could even have been done with a single insert statement! I wonder how people fail to recognize an N+1 selects problem when it's staring them in the face.

Well, to be fair, this problem I described isn't exactly an N+1 problem is it? More like an N(M(L+1)+1)+1 selects problem. ;-) (Unless I've got my math all wrong there?)

How I hate working with PL/SQL stored procedures! :(

nithinbekal··on Loosing interest to code.
Replace COBOL with PL/SQL and that's exactly my story. Here are a few things I could suggest:

- Start with a smaller project, something that you could finish over a weekend. Finishing that kind of a project will leave you with the confidence to continue with more demanding projects.

- If you're working on a larger project, split it into smaller chunks. Make a list of things that could take, say, half an hour, and complete them as and when you get the time.

- Don't depend on others for motivation - motivate yourself. If you don't know why you want ot work on your own hobby projects, nobody else would.

There are lots of people I know that struggle to find the time to work on side projects. Funnily enough, I see that people working in startups find it as hard as us corporate IT folks to find the time.

nithinbekal··on Ruby on Rails to power 13,000 schools with 7million+ students in Kerala, India
That would be a challenge, wouldn't it? Without tests, a lot of people would hesitate to contribute, and with a small group of developers it would take some time to add tests to a somewhat large project like this.

Any plans from Foradian on this front?

Page 1 of 2Next →