Earlier quoted context omitted.
I would also really like to use Pharo more. I tried it for Advent of Code last year [0]. However, I just can't get over the unmanageable custom windowing system going on within the main window. Their isn't an easy way to iterate through windows, find windows, close windows and stop them from overlapping with each other all the time! It would be great to have some kind of Jetbrains/VSCode/modern IDE style layout where…
Would https://github.com/unchartedworks/SmalltalkVimMode help with your vim needs? (I'm not into vim so I have no idea if that's the best place to start.)
Ask HN: Why are you programming your hobby projects in a niche language?
161–170 of 172 posts
Re: Ask HN: Why are you programming your hobby projects in a niche language?
#162Earlier quoted context omitted.
> Because I can't get a job writing Haskell without having a PhD and some 5+ years of experience in the language even though I've been in the SWE field for 10+ years I got a Haskell job and don't even have a degree.
Would love haskell advice
Re: Ask HN: Why are you programming your hobby projects in a niche language?
#163I did the licensing server for Lunar ( https://lunar.fyi/ ) in Crystal. It’s been a joy to work with it! The standard library for working with strings, JSON, YAML and XML is top notch. Type safe and extremely fast, very important characteristics for a licensing server that is queried hundreds of times a second. I used the super simple Kemal HTTP server library which I like for APIs where most of the logic happens on…
Re: Ask HN: Why are you programming your hobby projects in a niche language?
#164I did the licensing server for Lunar ( https://lunar.fyi/ ) in Crystal. It’s been a joy to work with it! The standard library for working with strings, JSON, YAML and XML is top notch. Type safe and extremely fast, very important characteristics for a licensing server that is queried hundreds of times a second. I used the super simple Kemal HTTP server library which I like for APIs where most of the logic happens on…
I recently tried out Crystal (on a project that went nowhere very quickly) and liked what I got out of it. However, I feel the language is very complex in terms of operators and language constructs and found myself quickly completely forgetting language features even exist. There's a balance somewhere of "neatly fitting in your head" and "too simple" and Crystal firmly falls in the former for me.
But I really miss some of Crystal’s features in other languages I work with:
1. Being able to declare union types when ingesting some not-so-normalized data
alias UserID = String | Int32 | UUID
2. Macros and meta-programmingFor example here I have a `storedprop` macro which I can use to define propertied that get saved automatically to a YAML config when they are changed: https://f.lunar.fyi/uRW69B/settings.cr
class Settings
include YAML::Serializable
storedprop host : String = "ddcutil-server.local"
storedprop port : UInt16 = 3485
end
The good thing is you’re not really required to learn this stuff if you don’t want. But they surely can make the language fit to your style better if you invest the time to understand them.Re: Ask HN: Why are you programming your hobby projects in a niche language?
#165Re: Ask HN: Why are you programming your hobby projects in a niche language?
#166I've been enjoying learning some new niche languages over the past year, Nim and V, using my favorite types of hobby projects to do so. I started learning Nim a few years ago, and came back to it last year after seeing it had improved in a number of areas. I started working on a practical utility, a self-contained document uploader system that could be customized for certain departments at work. Eg, take a Word docum…
If you used to use Delphi then why not use freepascal and Lazarus? Seems like an ideal match for your needs.
The first time, after several years of working with Python, I missed the dynamic data structures like lists and dictionaries. Open arrays work pretty well, but Pascal still requires a lot of overhead to set things up compared to `d = {}`.
The next time I got a bit further with it, but I remember everything being just slightly different enough that I had to dig for examples and documentation to do simple things I used to do easily in Delphi. I think I got some of my old graphics programs working but there was enough friction that I lost interest and moved on.
But its worth giving it another shot since I have a lot of old Pascal code I'd like to play with again, and knowing about these difficulties going in I might do a better job next time.
What I like about Nim is the terse syntax similar to Python, and the more dynamic data structures like sequence, but also the typing similar to Pascal and the compiling to executable thanks to C. I like the V language too for its batteries-included nature, but haven't gotten far enough with it yet to tell if I will stick with it. The docs are a good start, but they only have Discord for a community and that is hard to work with.
Re: Ask HN: Why are you programming your hobby projects in a niche language?
#167Earlier quoted context omitted.
Can I ask 2 questions? 1) Would you consider open sourcing the licensing server in Crystal? 2) What's your revenue with Lunar? :) Thanks!
1. Yes, I’ve been working on generalizing the Lunar specific code for open sourcing it next month. Still WIP because I’m still getting busy with new monitor edge cases. Last month I’ve also found out about Keygen ( https://keygen.sh/ ) which has a really nice offering, and I would have probably chosen it instead of building my own solution if I’d known about it. I’m concerned about uptime with my own solution, I don’…
Also curious -- from your OP re: Crystal:
> It’s been a joy to work with it! The standard library for working with strings, JSON, YAML and XML is top notch. Type safe and extremely fast, very important characteristics for a licensing server that is queried hundreds of times a second.
You said you're doing ~$3.5k/mo in licenses for Lunar. Where's the licensing volume coming from here? Keygen handles licensing for hundreds of products and millions of devices and I very rarely hit 100 RPS even on a busy day, so kind of curious how your licensing is setup to produce that much volume. :)
Re: Ask HN: Why are you programming your hobby projects in a niche language?
#168Earlier quoted context omitted.
1. Yes, I’ve been working on generalizing the Lunar specific code for open sourcing it next month. Still WIP because I’m still getting busy with new monitor edge cases. Last month I’ve also found out about Keygen ( https://keygen.sh/ ) which has a really nice offering, and I would have probably chosen it instead of building my own solution if I’d known about it. I’m concerned about uptime with my own solution, I don’…
Founder of keygen.sh here. Thanks for the mention. Bummer you didn't know of it before, but I'm really working on improving SEO so hopefully that'll change for the next person. I actually checked out the source code for Lunar awhile back while digging around seeing how devs use Sparkle, since I've been working on an integration there for auto upgrades, along with a Swift SDK. Let me know if you ever hit a point with…
I’m already looking into using Keygen for my next non-AppStore app. I’ll definitely reach out if I have any concern. Although from what I saw, your site explains everything well, and the dev tier will be helpful in testing.
I’m not getting 100 RPS constantly. It happens rarely, mostly when releasing updates. When an update is detected, Lunar has to check if the period of free updates hasn’t ended. Then the server is contacted again when the new version is launched.
With 3000 pro users (some received licenses for free because they donated when Lunar was free), 100 RPS can happen for short bursts and the server has to cope well with this even if it happens rarely.
Re: Ask HN: Why are you programming your hobby projects in a niche language?
#169Earlier quoted context omitted.
As someone who dabbled in Scala in school and a professional Kotlin programmer, hearing someone recommend Scala as a sane alternative makes me fearful of Haskell.
It's not so much Haskell that is to blame, but how it's used in practice. To be fair, I have seen similar over-complicated projects in Scala and even in Java: but there it seems to be more rare. The problem is, you have this language which offers you a million handy little tricks which seem very useful for all kinds of little niche problems. The boring and common sense approach would be not to use them, because it wo…
The focus should be on the core abstractions like Functor, Monad, Monoid, Applicative, etc that are sound, non-leaky, universal abstractions that are useful for all kinds of little niche problems.
> The boring and common sense approach would be not to use them, because it would give your colleagues too many headaches to figure out what they are and why you chose to use them. But in practice the temptation is often too strong.
The boring Haskell approach you describe should include taking advantage of those core abstractions.
If your coworkers don't get them, they should learn the core abstractions and how to use them.
Re: Ask HN: Why are you programming your hobby projects in a niche language?
#170I thought it would be interesting and appropriate to write the high level behavior code for a home automation system in Prolog so I did. It has evolved a lot, but has been running things in the house for almost 20 years now. It currently sends commands and receives stimuli via MQTT and is running in a Docker container.
That sounds awesome, is anything about it open-source?
Look in the examples directory for some basic pub/sub code.
The Prolog code that runs in my house is pretty specific to my house so I figured the best way to open source things would be as a framework more than an implementation. You can contact me via issues on the github repo and prod me into adding some more advanced examples - I've learned a lot since my last commit on the repo.
I've started using the Redis functionality recently added to SWI-Prolog, so my code now responds to MQTT messages and uses state queried from Redis to help determine what actions (implemented by sent MQTT messages) to send out. The beauty is that since I don't do anything that blocks significantly in the Prolog code it is now single threaded - even the MQTT listening. It still responds quickly enough and is MUCH easier to deal with than multi-threaded.
An example of what I'm doing is I built a bunch of ESP8266/EESP32 display devices that control neopixels/OLED/LCD displays. When one of those devices boots it sends a MQTT message announcing its location and capabilities (display type, bit depth, dimensions). Prolog receives that message and then stores that info in Redis. So that device info is all dynamic.
So then later Prolog might get a notification that something is in the driveway. All by MQTT it requests an image from the appropriate camera, then sends the image off to Sighthound and deepstack image recognition servers. The Sighthound front end sends a message back to Prolog with a description of any vehicle spotted which Prolog then matches against known vehicles. If it determines for example that a Fedex truck is in the driveway then Prolog sends notifications around the house - it queries all the display devices from Redis and then based on the capabilities of each devices creates a JSON formatted MQTT message to send to each announcing the Fedex truck. It then also sends a MQTT message to some Java code that connects with Google and sends a push message to an Android app I wrote that displays the alert on my phone and watch.
Before I switched to MQTT I was using Prolog with CORBA as the message transport and back then I also had Visual Basic and MS Agent as part of the system. One night I got bored and a little while later had 3 Peedy the Parrot characters singing Row Your Boat in a round across three different computers coordinated by Prolog. It was actually only a page worth of custom Prolog code for that.