HNHacker News
TopNewBestAskShowJobs

virtualwhys

3,419 karma · joined January 3, 2013

N.S. Cutler (https://github.com/godenji)

Backend Scala developer since 2012. Enjoy relational databases combined with FQLs in the vein of Slick, Quill, Esqueleto, LINQ to SQL, etc.

Also work with Scala.js, and Angular + TypeScript on the frontend.

submissionscomments
virtualwhys··on The database I wish I had
> What I miss from it that SQLite doesn’t provide is the ability to run it on the browser.

Cries in abandoned Web SQL[0]

[0] https://en.m.wikipedia.org/wiki/Web_SQL_Database

virtualwhys··on MonitorControl: Control external monitor brightness and volume on your Mac
An eye saver with this ultra lightweight 16" USB-C travel monitor I picked up.

On resume from suspend the monitor always dims down to some ridiculously low setting, and without `ddcutil` I'd have to manually adjust the brightness via hardware toggle. As a workaround for the limitation of the monitor I just have a bash script that invokes `ddcutil` on resume from suspend - wonderful :)

virtualwhys··on Flutter for Linux
> The real value comes in its code generation features, which enable packages to add whatever language features they want

Got any eamples of ADTs, pattern matching, immutable collections, data classes, named parameters, etc.?

Coming from Scala and TypeScript the Dart language is pretty unappealing wrt syntax and functionality, kind of archaic actually. Flutter looks amazing and have been hoping that Dart would evolve more quickly than it has.

virtualwhys··on Sweden: higher Covid-19 death rate while failing to collect on economic gains
Really? I've been in Da Nang, Vietnam for over 5 months now, and the fine for not wearing a mask only came during the short quarantine period (@3 weeks) at the start of April.

When I arrived at the end of January (during the Chinese New Year) there were thousands of Chinese tourists mobbing the convenience stores buying up all the masks they could find. At the time I wasn't really aware of what was happening, but clearly they were a step ahead of the game, likely based on past history with SARS and news coming from friends and family back home.

It's pretty amazing how low the case count has been in Vietnam; some locals say, "don't believe the government", but you'd expect any outbreaks/deaths related to COVID-19 to have gotten out by now if the government were in fact trying to hide something.

virtualwhys··on No More Coffee
Quit coffee 3 years ago, one of the best things I've ever done for myself.

Since coffee is pretty much universally accepted in the world (even more so than alcohol), one can easily view a strong coffee habit as normal, or at worst a benign vice. And it's fine as far as addictions go; you can ride the caffeine wave to increased productivity, and when the effects wear off another cup of liquid inspiration is there waiting. I did this for close to 15 years.

What bothered me was this feeling of being ruled by the habit. I simply had to have my two jam packed triple espresso lattes (or equivalent when not at home), one in the morning, and one in the afternoon; there was never serious consideration given to the thought, "I know, let's not have coffee this weekend", just a steamroller habit with me along for the ride.

Ironically what got me to quit coffee (and I had no intention of doing so) was a "retreat" in Mexico where one of the requirements was following a strict diet 2 days before and 4 days after the experience. One of the restrictions was no coffee, which part of me was strongly resisting, to the point of considering withdrawing (hah) from something I'd already spent several hundred dollars for.

In the end I went ahead with it. On the 4th day after the retreat I was free, and commenced preparing a strong pot of rocket fuel, but then something within me realized, "wait, I don't need this anymore".

And I don't, at all. Coffee is the devil made liquid -- proceed with caution :)

[0] i.e. even when sick, on off days from work, during vacation, etc.

virtualwhys··on My 2020 desk setup
Thanks for creating i3, have been using it for years -- stacked tabs are indeed great, as is basically everything else in this wondrous WM.

i3 is solidly in the "pry it from cold, dead hands" category.

virtualwhys··on Breathing habits are related to physical and mental health
/s/Sato/Soto
virtualwhys··on Ask HN: Production Lisp in 2020?
Got a public repo to share that would show how you pulled this off?

Barring that, as a sibling comment asks, what specific framework and/or libraries did you use to achieve the holy grail of sharing-all-the-things? (thought ReactNative required implementing separate UI for iOS and Android).

Sub second hot reload sounds amazing, btw.

virtualwhys··on Gleam: A statically typed language for the Erlang VM
Not an Erlang user, but I must say the syntax is beautiful.

I know, semantics before syntax, but if you can have both, why not?

Looks promising, love the ML-style pattern matching in particular, so clean and terse (wish Scala 3 would ditch the `case` keyword in match statements, but alas not happening)

virtualwhys··on Gleam: A statically typed language for the Erlang VM
See Akka Typed (based on the Actor model) for an example of typed message passing in a distributed system.

Not sure what compromises were made, but it was a sore point for users of the library for years to throw around untyped messages when the host language (Scala) provided such a powerful type system.

virtualwhys··on Nasty macOS flaw is bricking MacBooks: Don't install this update
Have been on Fedora for 10 years; the only thing that "reliably" breaks is the proprietary Nvidia driver.

Otherwise Linux is pretty damn rock solid. These days "it just works" applies to Linux more than any other OS.

And with the new Nvidia-less Dell Precision 5400 the system runs cool and quiet to boot.

Linux isn't what it used to be...

virtualwhys··on How to Avoid the Assignment Statement (2010)
Depends on the language.

In Scala the idiomatic approach would be to favor the immutable/recursive version.

    def min(foos: List[Int]): Option[Int] = foos match {
      case Nil => None
      case x :: Nil => Some(x)
      case x :: xs =>
        min(xs).filter(_ < x) orElse Some(x)
    }
virtualwhys··on Valtan: Common Lisp to JavaScript Compiler
> Clojurescript is one of the most stable and better choices for writing production-ready web-apps.

Why? TypeScript, for example, is used pretty much everywhere these days; all the other languages are completely niche. I dislike the language (mutability everywhere, no standard lib), but it's dominating the frontend world ATM.

I've been using Scala.js in production apps for around 3 years now. Curious in your experience what advantages Clojurescript has over Scala.js. I ask because you often hear things like "best in class" when Clojure devs talk about the frontend development experience.

virtualwhys··on High Temperature and High Humidity Reduce the Transmission of Covid-19
What doesn't feel right?

The abstract states that high temperature and high humidity reduce transmission rates relative to colder climates, which corresponds with the high transmission rates during the northern hemisphere winter and early spring.

And yes, lack of testing has resulted in some eyebrow raising numbers.

Up in Da Nang now, both locals and foreigners are aware and taking it seriously -- scary times.

virtualwhys··on Websites have evolved back to static HTML/CSS/JS files
> because who wants to reload the page multiple times

happily, please, yes.

The browser caches pretty much everything but the HTML, so the payload is minimal. A fast SSR site is a dream compared to the myriad poorly implemented SPAs out there.

It's ridiculous going to, for example, an airline site; trying to book a flight and discovering that the damn reservation process is borked due to an uncaught exception in the latest update to the SPA (in which case the house of cards collapses, fun).

With an SSR the JS footprint is much smaller, which can lead to more stable/reliable apps.

I find the modern web to be a complete mess, but the loading spinners are nice, provided that the loading actually finishes (if it doesn't, look in the console and you'll likely find your answer in red).

virtualwhys··on Travelling with 24” Monitors
These days mostly work in Scala and TypeScript. Just another web developer that works on the road, basically.
virtualwhys··on Travelling with 24” Monitors
Not sure if this will help, but with my USB-C monitor the default brightness/contrast is poor, and requires manually fiddling with the settings on every boot/resume from sleep, so I found a Linux utility that does the fiddling for me:

    cat ~/bin/brightness 
    #!/bin/bash
    #
    echo "increasing brightness/contrast of external monitor"
    /usr/local/bin/ddcutil --display 1 setvcp 10 40
    /usr/local/bin/ddcutil --display 1 setvcp 12 10
Tie the above in with your init/resume scripts and you're good to go (assumes that your issue isn't limited by the hardware itself).
virtualwhys··on Travelling with 24” Monitors
Creative solution, nicely done.

For 15 years I traveled with some flavor of 23"/24" monitor, putting it into my checked bag, and paying that checked bag fee over and over and over (probably $5K USD over the years).

This year I scrapped the big monitor setup and got an ultra lightweight 16" USB-C powered monitor along with a Dell Precision 5540.

Now I just stuff everything into an REI Trail pack (40L) and walk on the plane, it's beautiful. Pack weight is around 7KG, which works for most airlines in the world.

No longer muling around tons of gear is wonderful. Not sure what I was thinking, the extra screen real estate isn't that important to my work, two screens about 16" is enough.

Here's the 16" external monitor [1], out of stock presently, but can vouch for it, great addition to the toolbox.

[1] https://www.amazon.com/gp/product/B07WJJMV48/ref=ppx_yo_dt_b...

virtualwhys··on Java 14 Feature Spotlight: Records
Actually, implicits aren't going anywhere in Scala 3.

There will be new syntax, but otherwise the underlying semantics will remain the same; it's just the implicit keyword itself and the kitchen sink of functionality that it provides in Scala 2 will be split up into new (soft) keywords like "given foo(using: Bar) = ..." rather than "implicit def foo(implicit bar: Bar) = ...", along with "extension listOps of" replacing "implicit class ListOps ...".

The community isn't united over the proposed changes (mostly due to migration concerns it seems), but overall it looks like a nice improvement over the status quo, particularly around typeclass definitions.

virtualwhys··on 5-MeO-DMT: 20-minute psychoactive experience that’s transforming lives
There is no preparation for 5MeO per se, as no amount of meditation, yoga, mantra practice, etc. can save you during the experience, but certainly abstaining from alcohol, eating a vegetarian diet, avoiding conflict in the days leading up to the ceremony, and so on, are recommended by the facilitator.

As far as integration goes, I mean, who really knows the territory of the infinite such that they can help another through some difficulty in their own unique path? Most facilitators that I've seen just collect the rather large cash based consulting fee and move on to the next group, with a hug or pat on the back if a participant had a difficult journey.

I'm certainly skeptical when there's an undeniable profit motive involved, so the whole facilitator role is a bit overblown; there's no shamanic tradition behind Bufo (discovered in the 80s), it's just people that have had experience with the substance serving it to others, hopefully with good intentions.

virtualwhys··on 5-MeO-DMT: 20-minute psychoactive experience that’s transforming lives
Having witnessed at least 100 sessions, there are no long-term changes beyond the participant having intimately experienced some aspect of the infinite (whether it be harrowing or blissful) and as a result knowing that that potentiality exists.

Behaviorally most just go back to the same patterns and aren't particularly changed. Ayahuasca, due to the before/after dietary constraints, is more effective (IMO) in inducing lifestyle changes.

That said, 5MeO is the death experience (i.e. it very likely mirrors the experience at the moment of physical death) and is, if nothing else, great practice for the real thing :)

In terms of adverse effects, some wounded warriors take days, weeks, or even months to heal, but that's the same for any psychedelic, a segment of the population will be adversely affected.

Also, 5MeO can be abused; I've encountered at least one facilitator who takes it daily (over 3K journeys), which seems somewhat excessive, and can be seen in their flat affect (i.e. you'd expect such a being to radiate joy if number of journeys === depth of experience).

virtualwhys··on China to inject $174B of liquidity on Monday as markets reopen
Even outside Mile End? I think the large Orthodox Jewish community there has had some influence on the prevalence of Bagel shops in the area.

Don't recall downtown, or even other areas of the plateau as having such popular bagel shops.

virtualwhys··on Records Come to Java
> Records, for example, are directly inspired by Kotlin's data classes, and function almost identically... except that Kotlin allows you to have mutable or immutable fields in a data class, and automatically provides a `copy` method (similar to Lombok's `wither`) that allows you to use a builder pattern.

Sounds a lot like Scala case classes. More accurate to say that both Java records and Kotlin data classes are inspired by Scala case classes -- not that it matters, programming languages authors are constantly stealing ideas (sorry, drawing inspiration) from other languages; thereby moving the state of the art into the mainstream.

virtualwhys··on F# Data Type Providers in .Net Core (2018)
Everything happens at compile time, no runtime reflection, on whatever schema you throw at it (json, sql, etc.), with instantaneous IDE code completion -- it's totally amazing.

Not aware of any mainstream language that provides similar functionality.

virtualwhys··on Flutter vs. Other Mobile Development Frameworks: A UI and Performance Experiment
By some measures Flutter is taking off [1], and it's Github repo has certainly drawn some interest [2]. At any rate, Flutter is far from unpopular, and is iirc the youngest of any of the competing frameworks.

[1] https://trends.google.com/trends/explore?q=%2Fg%2F11f03_rzbg...

[2] https://github.com/flutter/flutter

virtualwhys··on LSD – My Problem Child (1980) [pdf]
> Try vipassana before LSD, it will help. It will kick ur ass, but youll heal some deep seated issues.

Not necessarily. While rare I've seen 2 psychotics breaks (requiring hospitalization) occur on meditation retreats -- 1 a ten-day Vipasana retreat; the other a 7-day Zen retreat.

Obviously meditation and intensive retreats can be effective , much like deep substance induced psychedilc experiences, but there are no guarantees, so blanket statements like, "do X, it worked for me" may unintentionally send one down the road to hell despite your good intentions :)

p.s. meditation, particularly of the <= 1 hour variety, is almost certainly safe for everyone; it's the intensive retreats and large dose induced psychedelic psychosis that impose a much greater risk.

virtualwhys··on State of JavaScript 2019
> there really isn't a compelling reason to build anything in a Webview as far as I know.

Neither RN nor Flutter fulfill the promise of, "write once, run everywhere", whereas Ionic, warts and all, does today.

Maybe Flutter web will work out though, we'll see. If Dart evolves then Flutter becomes a pretty compelling stack.

virtualwhys··on Kotlin vs. Java
> Have other languages done this before?

Well, yeah, Scala obviously, the primary language from which Kotlin drew inspiration for its syntax and features.

virtualwhys··on IBM Stops Server Side Swift Framework Development
Pretty niche indeed. Have you actually pulled off a PWA + Android + iOS in Scala?

PWA is easy enough with Scala/Scala.js but I assumed that Android + iOS was a sufficiently painful process to warrant avoiding the attempt. Thought about mixing in Cordova or perhaps Ionic via the excellent ScalablyTyped typings library, but the path of least resistance is to just use TS on the frontend.

virtualwhys··on How the Library of Congress Unrolled a 2000-Year-Old Buddhist Scroll
> Finally translated, the final scroll has no title, beginning, or end

How apropos wrt Buddha's non-teaching. Given more time (decay) the teaching would be fully revealed :)

← PreviousPage 4 of 32Next →