HNHacker News
TopNewBestAskShowJobs

anuragsoni

2,167 karma · joined October 25, 2014

submissionscomments
anuragsoni··on Ubuntu 21.04 Will Use Wayland by Default
The original forum post [1] that this article mentions has more details, and some discussions that also include Ubuntu devs.

[1] https://discourse.ubuntu.com/t/trying-wayland-by-default-aga...

anuragsoni··on Element (Matrix chat app) suspended from the Google Play Store
I believe the parent comment is referencing the fact that the Element application used to be called Riot [1].

[1] https://element.io/blog/welcome-to-element/

anuragsoni··on The RustyHermit Unikernel
The `opium_kernel` example I linked to above is running on top of https://github.com/dinosaure/paf-le-chien which is a mirage layer for httpaf. Opium itself has also moved to using httpaf as the underlying layer.
anuragsoni··on The RustyHermit Unikernel
Lwt [1] based web frameworks can be used on MirageOS if they provide an interface that allows someone to swap out the unix dependent pieces. One such framework is Opium [2], that provides most of its features in a unix independent code library `opium_kernel`. Its fairly straightforward to run an opium app on mirage. This example needs to be updated to the newest apis in the released version of Opium but this can provide some hints about how to run an opium app on mirage: https://github.com/anuragsoni/ocaml-opium-unikernel.

If a lower level web toolkit is sufficient then ocaml's cohttp [3] library has been available on mirage for quite some time now.

[1] https://github.com/ocsigen/lwt/

[2] https://github.com/rgrinberg/opium

[3] https://github.com/mirage/ocaml-cohttp/

anuragsoni··on The Problem with Gradle
I concur. I worked on a java project at a previous job and Bazel was instrumental in getting fast deterministic builds. There were some growing pains as the bazel docs weren't great back then (this was before bazel reached 1.0), but once we got things to work it was nice to work with. We were able to leverage Bazel for our Angular application as well so it was nice to have everything building with one tool.

> A big part of the reason is that tools suck as Buck (which, like Bazel, uses Skylark as the language, which is a very limited python in essence) avoid the general programming patterns to avoid the issues described here.

I also agree with this. My current language of choice is OCaml and the most popular build tool is dune [1], which uses an s-expression based configuration language, and its nice to have a more restrictive DSL that avoids some pitfalls of using a full blown programming language for configuring builds.

[1] https://dune.build/

anuragsoni··on Ask HN: Is anyone using Linux on the 2020 Thinkpad X1 Fold?
The X1 fold is a different device [1]. Its the first foldable in the thinkpad line.

[1] https://www.lenovo.com/us/en/laptops/thinkpad/thinkpad-x1/X1...

anuragsoni··on Ask HN: Best Paid Gmail Replacement?
I've been using Fastmail [1] for around five years now. I've been pretty happy with their service and I use it with my own domain name. I find the pricing to be reasonable, and their webmail interface is really fast, and I've found their spam detection to be really good.

[1] https://www.fastmail.com/

anuragsoni··on Standard ML in 2020
> You are correct that Ocaml has a ref type (though I believe it is actually a special case of a mutable record with one field). > There is a small difference between an immutable record of which one property is a reference to changing data and a mutable record where the record itself changes. I prefer the first though I realize this is mostly preference.

In OCaml ref is defined as

  type nonrec 'a ref = 'a ref = { mutable contents : 'a }
so it is an immutable record which contains one item which is mutable.

> In any case, the idea of outright changing a formerly mutable structure to an immutable one would be unthinkable in most languages due to all the breakages it is likely to cause.

I agree with you. I started using OCaml in 2018 but I believe many linux distributions stayed on OCaml 4.05 (the release before safe-string was default) for a while because of breakages.

anuragsoni··on Standard ML in 2020
> I find the `ref` syntax of SML much nicer to use than the mutable record syntax in Ocaml.

Maybe I'm missing something in SML, but OCaml has `ref` as well and it works just like SML's?

  let x = ref 0
  x := 12
  print_int !x

> SML strings are immutable which lends itself to a lot of potential optimizations (and there's always byte arrays if you actually need to mutate).

OCaml's strings are also immutable. They have been immutable by default since 2017 and prior to that one could opt into this behavior via a compiler flag.

anuragsoni··on DigitalOcean App Platform
Nanobox was acquired by Digitalocean. More details at https://www.digitalocean.com/blog/digitalocean-acquires-nano...
anuragsoni··on Why some people suffer from a stutter
My stutter has been my primary source of stress/anxiety for that last 12 years. Its impacted my time in college and then later at Grad School. I've had good days and bad (more good days lately), but i'll never forget the terror I used to feel whenever I had to present something in front of other people.

I skipped classes to avoid doing that, i bombed many a presentation because I had trouble with certain sentences and it impacted my grades. I think not being able to make the best of time in grad school is something I can get over eventually, but a bigger regret I have is not being able to make meaningful connections with my peers in school because I'd avoid hanging out with people because of my anxiety over my stutter. In a way it almost feels like I never experienced

I still have issues with words starting with "A" which is unfortunate since my name starts with an A. I still speak really quickly which i think comes from a habit of trying to get through speech quickly to get it over with.

I do believe that a lot of it is mostly because of my anxiety as I speak just fine when i'm relaxed, and I've been trying to work on using different words when I feel like certain phrases/words will cause problems.

anuragsoni··on What’s New in Thunderbird 78
I was full time on linux at a previous job where the company used Exchange. I tried davmail (for email, calendar, contacts), a combination of exchange imap + tbsync for contacts, calendar etc, but they all seemed a little flaky at best. The solution i settled on was Gnome's evolution. It was really seamless and everything worked just as well as using the Outlook app on windows/app. I went through the Gnome Online Accounts integration but you can add the account from within evolution as well.

I really like Thunderbird, but if you need to use exchange and are on linux I think there isn't a nicer option than Evolution at the moment. It plays nice with all MS services and integrates with the OS for contacts, calendar etc.

Ofcourse all of this only applies if you are using Linux and its possible evolution is annoying on non gnome systems (i haven't tried it outside of gnome). I think kmail also has exchange support but i haven't tried it.

anuragsoni··on Don't close your MacBook with a cover over the camera
Lenovo gets pretty close. Most thinkpads starting from 2018 have a thin plastic cover to block the camera [1]

[1] https://www.thinkwiki.org/wiki/ThinkShutter

anuragsoni··on New system76 laptop: Oryx Pro
This is almost ideal for what i'm looking for in a laptop. I wish there was an option to get a better screen and no nvidia.

I might be in the small group who wants this, but i wish it was easy to find a 15" laptop with a CPU like the one in oryx but without an NVIDIA gpu. I'd like to have a better cpu and i don't mind a laptop that's larger than the xps 13 or carbon, but i don't need/want a dedicated nvidia gpu. While we are wishing for things, please make more laptops with higher dpi screens. There are a lot of options for 1080p or lower, but very few good options (outside of macbooks or dell xps) that have high quality UHD displays.

I'm on the market for a new laptop and the screen quality is the only reason i'm even contemplating a macbook.

anuragsoni··on Progress on Plasma
Whenever i've tried KDE my favorite experience has been on OpenSUSE Tumbleweed. Its a rolling distro, but provides a really nice installer and stable experience because of their automated QA process. The KDE stack is provided as intended by upstream without much customizations (they use their wallpaper for the lock screen and desktop), and the updates are quick. If you try it, you might also like their support for btrfs + snapshots. If an update isn't to your liking, it'll allow you to boot into an old snapshot and rollback.

I still use tumbleweed, but with Gnome and this has been my distro of choice for the past couple of years. (I moved from Ubuntu)

anuragsoni··on Multicore OCaml: March 2020 update
ReasonML can target native platforms transparently by using the OCaml compiler toolchain. dune (OCaml build tool) supports ReasonML out of the box.
anuragsoni··on Multicore OCaml: March 2020 update
It's been really nice to see these updates from the multicore team. I'm looking forward to the systhread support using the Domain/Atomic modules. Being able to build recent versions of dune is something i'm looking forward to. That'll make it really easy to try (and hopefully contribute/port examples and benchmarks) to the multicore project.
anuragsoni··on Fastmail – 20 Years Old
Do you have to configure the individual alias in the app? If so I can see it getting really tedious to keep it in sync with the aliases inside fastmail.
anuragsoni··on Fastmail – 20 Years Old
My use case might not be too common, but I use fastmail with multiple aliases and the official app is the only way for me to send emails with these different aliases.

Another reason is the lack of push notification (not sure if i'm using the right term) when using the built in gmail app for fastmail. It only gives me the option to poll every 15 minutes. The gmail app also doesn't support actions like snooze, swipe to archive etc on non-gmail accounts and I like having that in the fast mail app.

anuragsoni··on My transition to an Ubuntu workstation
Similar to you I keep mine in a git repository, but I use dotbot[1] to manage the symlinks to the proper paths.

[1] https://github.com/anishathalye/dotbot

anuragsoni··on Ask HN: Best Laptop for Developer?
It does support gestures. Gnome and KDE use libinput these days which has support for 3-finger, 4-finger gestures (Both have some gestures enabled by default when using wayland)
anuragsoni··on Ask HN: Best Laptop for Developer?
You can't go wrong with anything from the Thinkpad T or X lines (you might be able to find them refurbished/used for pretty reasonable price). The Dell XPS 13 is another decent option but can be pricy.

For my personal use i've been using the Huawei Matebook X pro since last year. Things i dislike: no linux driver for the fingerprint scanner, there wasn't an option for me to buy the model with 16GB ram without Nvidia (its not a problem if you plan to run Ubuntu, etc). Things i like about it: The screen (3:2 screen is growing on me), the built quality seems really nice, its light but feels very sturdy. Good port selection, It has two USB-C + 1 regular USB-A port. The battery life is really good.

anuragsoni··on LastPass bug leaks credentials from previous site
I like using a third party alternative since it gives me the option to use it outside the google ecosystem. I use Firefox and Chrome regularly so the seamless syncing without depending on any particular browser is important for me.

The other feature I like in dedicated password managers is that they tend to have a lot more options about what kind of password/passphrase you can generate. Some other features that i regularly use is storing non password content like software licenses, sharing certain passwords with my spouse, etc.

anuragsoni··on Ask HN: Who wants to be hired? (September 2019)
Location: Greater Boston Area

Remote: Yes

Willing to relocate: No

Technologies: OCaml, C++, Rust, Elixir, Typescript, Scala

Github: https://github.com/anuragsoni

Email: hackernews@sonianurag.com

Linkedin: https://www.linkedin.com/in/anuragsoni13/

Résumé: Available on the Linkedin page. I can email a pdf copy on request.

Currently working as a full-stack engineer. I'm looking to transition back to a more backend focussed role. Most of my work experience has been using C++ to build backend systems, but i've recently been using Typescript (with Angular) and Java for my current team at work.

Outside of work my current interests have been OCaml and working on improving the OCaml story for web usecases. example: https://github.com/anuragsoni/routes

anuragsoni··on Generalized Algebraic Data Types: A Primer
FWIW OCaml (the linked example is using reason, a different syntax for OCaml) doesn't need a syntax extension for GADTs.

On a similar note i find the OCaml syntax easier to read than Reason's. (There is an option to toggle between the two in the linked website)

The example from your post in OCaml:

  type 'a restricted_maybe =
    | JustInt : int -> int restricted_maybe
    | JustString : string -> string restricted_maybe
    | Nothing : 'a restricted_maybe
anuragsoni··on OCaml 4.08
There is some good work going on for the lower level pieces:

https://github.com/anmonteiro/ocaml-h2 - HTTP2 stack

https://github.com/inhabitedtype/httpaf - HTTP stack

For micro-frameworks there are a few options available like

https://github.com/rgrinberg/opium

https://github.com/ostera/httpkit

There are some scattered pieces in the ecosystem for routing, sessions etc but i agree that compared to Python, JS, etc the ecosystem might not look as cohesive or expansive for web applications. So there should definitely be room to have new solutions in this space

anuragsoni··on OCaml 4.08
While not a traditional IDE, Merlin [1] combined with vim/emacs/vscode is really good (autocompletion, jump to definition, type lookup and more). Merlin also gained support for language server protocol recently so that could be an option for any editor/IDE that has a language server client.

[1] https://github.com/ocaml/merlin.git

EDIT: I'd also like to point out OCamlformat (https://github.com/ocaml-ppx/ocamlformat). It works really well in my experience and makes it really easy to perform automatic code formatting, and can be used in CI to check that changed conform to the formatting style a project prefers.

anuragsoni··on Web Programming with Continuations (2002) [pdf]
As mentioned in the document, continuation passing style can at times be a little difficult to read. That being said I found a talk that using continuation passing style to provide typed routing. [1]

This won't be the most efficient way to perform routing in an application, but i found the implementation really simple to understand and the error messages for the end-user seem really clear as well. It also helps if the language used allows for embedding DSLs that are easy to read for the end-user. (could be macros in lisp/elixir, well named functions with a little sprinkling of infix operators in OCaml, Haskell etc)

A little show HN in the comments: I've been exploring this approach and others [2] for comparison, and although i've moved away from this style as I progress in learning more OCaml, it was a fun little exercise to explore a CPS based typed routing approach. [3]

[1] https://dbp.io/talks/2016/fn-continuations-haskell-meetup.pd...

[2] https://github.com/anuragsoni/routes

[3] https://github.com/anuragsoni/routes/blob/0.1.0/src/routes.m...

anuragsoni··on Things I Enjoy in Rust: Error Handling
While its true that one can use `unwrap`, pattern matching and other higher order methods available for the Result type are a more idiomatic way to work with these.

For example:

    match <something that returns result> {
        Ok (v) => <do something with v>,
        Err (some error) => <handle error>
    }
By using the result type, the compiler ensures that the only way to get a value out of the result type is via pattern matching. So the errors are still values, except there is no need to come up with a default value for the error scenario, and there is no need to come up with an "empty" value.

In isolation it might look verbose, but rust also provides a lot of higher order operations that one can do on result types. Ex:

    myResult.map(<do-something>).and_then(sq).or_else(<do-something-else>);
Something else that I personally like about a result type is that it also serves as documentation by clearly marking operations that can fail, and have a consistent way for the end-user to know which value indicates that the response is a success or an error.

EDIT: Formatting

anuragsoni··on The Bosque Programming Language
Nice discussion on an earlier post about this project: https://news.ycombinator.com/item?id=19671795
← PreviousPage 3 of 6Next →