HNHacker News
TopNewBestAskShowJobs

lilactown

849 karma · joined September 2, 2015

submissionscomments
lilactown··on Chunkwm – a tiling window manager for macOS
you have to have your mouse over/focus on the main body div, since it appears to be centered and overflow: hidden.
lilactown··on Fearless Concurrency: Clojure, Rust, Pony, Erlang and Dart
I used agents for things like polling (combined with a scheduling library) because the additional plumbing with core.async wasn't worth it. But it's pretty niche.
lilactown··on Next.js 8 released
I still think that you should endeavor to server-render anything you can get away with. Because of that, we have invested heavily in React SSR.

The biggest value-add of using React on the server is being able to share our design library and business logic with our front- and back-end. We can develop the structure, style and behavior of our website as React components and deploy them server side or client-side. In general, our team has found that the component model is far more composable than templates like pug, PHP, etc.

lilactown··on Apple patents MacBook with key switches under a flexible touchscreen keyboard
2015 MBP was great, but I also immensely enjoyed my 2013 MacBook Air. The Air's battery life, form factor and performance made it hands down the best laptop for its time.

I'm actually in the process of wiping it to give to a friend and feeling a bit of sadness. I use a 2017 MBP now - the screen is what finally got me - but you're right, todays hardware just doesn't compare to how it felt back then.

lilactown··on Lenses: Composable Getters and Setters for Functional Programming
Everything you said has nothing to do with lenses and everything to do with trying to satisfy some statically-typed aesthetics.

> First, it's possible that different elements of an array or different properties of an object has different shapes

I can't imagine how this would introduce any sort of difficulties w.r.t. lenses that aren't already present with normal getting and setting of nested structures (aka probably not much).

> Second, it's just difficult to get things right without a compiler's help

This has nothing to do with lenses and everything to do with you preferring the feel of static types. You go on to talk about a bunch of issues with complex constructs that really only exist in static typing.

Sometimes you write a wrong thing and get a runtime error. This happens in all dynamically typed languages (and many statically typed as well).

> Furthermore, without types... this rather elegant unification of getter and setter seems to be lost.

Like ya do. I don't see how this has any impact at all on developing applications.

lilactown··on Data Is Never “Raw”
Stuart Halloway has a saying: "To me, schema means power. So when people say 'schema-less', I hear 'power-less.'"
lilactown··on Why Do React Hooks Rely on Call Order?
Yep. We've been using what is akin to an apollo-client hook at work for the past ~9 months or so:

    (defn my-component []
      (let [user-data (data/pull! :user "{ user { firstName  } }")]
        (fn []
          (if (:loading @user-data)
            [:div "Loading..."]
            [:div "Hello, "
             (get-in @user-data [:data :user firstName]) "!"])))
I'm a bit surprised this pattern isn't more popular; having side-effectful functions return ratoms in a form-2 component seems almost as flexible as Hooks. It seems that most CLJS people try and keep their views more pure, which I think is honestly to their overall detriment. You miss out on the encapsulation and composition that React is espousing.

That being said, I intend to replace reagent soon with just raw React + a few helpers :P

lilactown··on Better Clojure formatting
I agree with everything he said... except the 80 col limit. I know I'll probably lose this fight, but I frequently write code on all sorts of different screen sizes broken into split panes (Code | REPL, Code | Browser, Code - REPL | Docs) and having a line limit makes this manageable.

Maybe 80 isn't the right one, but letting code stretch out to ad-infinitum (either with awkward line breaks or having to scroll) is a big ergonomic loss for me personally.

lilactown··on GraphQL: A Retrospective
Something like datalog would have been much more impressive, but then the burden of implementing a parser for your upstream services would have probably been way too much of a burden. It's too general to be useful :(
lilactown··on Why Standing Desks Are Overrated
Yeah I can't understand this. I've been in constant lower back pain for years, with it getting considerably worse over the last 12 months. All of the experts have told me that it is some condition or other primarily caused by (and definitely exacerbated by) sitting for extended periods of time.

I literally haven't sat in an office chair for longer than 20 mins for the last 12 weeks and my back is so much for the better.

lilactown··on Cycle.js – A functional and reactive JavaScript framework for predictable code
The sticks I would use to measure a framework like Cycle and re-frame are:

1. How well does it compose?

2. How simple are the tools?

Both re-frame and Cycle have their issues with composition.

Cycle has inherent complexity and difficulty with composing dynamic child-states and circular dependencies as outlined above. It sounds like there have been tools developed since I last used Cycle.js to ameliorate the difficulties in handling these cases.

Re-frame has complexity with composition because it uses an absolute global namespace, which makes multi-tenant scenarios very awkward and potentially insecure. This problem mainly exists in use cases like having a developer environment with multiple states of the application on the same page, consuming components developed by external teams, and server-side rendering. At the moment these are either worked around or avoided completely.

The simplicity of the tools is something that I am very passionate about. As someone infected by the Clojure virus, I am pretty excited about the ability to use regular functions that return data to build my applications. It has been several years since I went down the rabbit hole of "everything as a stream/observable." At the time I found it to be very intellectually exciting, but also very confusing. Functions and data are much more familiar tools to most developers and the ergonomics of designing, developing, and debugging functions and data are much more understood.

So in closing, I would choose re-frame over Cycle for a project that I was working with a team of developers on. For extremely large applications that needed to be developed cross-team and/or have a strong use-case for server-side rendering... I would probably pick something new- similar to re-frame, but which fixes it's issues with composition. I maaayyyyy be working on something like that. ;)

lilactown··on Cycle.js – A functional and reactive JavaScript framework for predictable code
Another difference I feel is worth mentioning: events in Cycle.js are "pull"-based. Look at how you can select an element in Cycle's DOM tree and subscribe to events to it as a stream.

Events in re-frame (and reagent and React.js in general) are "push"-based. You must be explicit in your UI tree which events we care about and when they are emitted.

I actually wrote a library a long time ago[0] to invert this in React and expose a more pull-based event API, but in practice it wasn't very ergonomic.

[0] https://github.com/Lokeh/observe-component

lilactown··on Cycle.js – A functional and reactive JavaScript framework for predictable code
[NOTE: I have much more experience using re-frame than Cycle.js, but have used both previously]

Cycle.js and re-frame, in some ways, are on opposite sides of various spectrums.

Cycle.js favors local reasoning and composability through modeling your application as a pure function that takes in streams (sources) and returns streams (sinks). All of your event handling, external data, DOM changes, etc. are explicitly tied together in your "main" function.

Cycle.js requires you to reason about, write and read your application code in terms of reactive "streams" of values. This means that a big part of your app's development is expressing it in terms of operations on reactive streams and using the language of whichever stream library you choose.

Re-frame favors separating your UI code (which you can compose) from state and other side effects (which are global) through it's use of named reactive subscriptions and dispatching of named events.

You register your app's events as functions that take in "coeffects" (e.g. the current state of your app) and returns "effects" as data, e.g. the new state of your application. You can also return other "effects" like the parameters for doing an HTTP request and what event to dispatch when it completes/fails. Your UI code is then written to dispatch the names of these events (e.g. on click) that will trigger the registered function and cause re-frame to run the returned effects.

You register your app's subscriptions as functions that take in the application state and return a materialized view of it. Your UI code is then written as functions that subscribe to the names of these subscriptions, take the materialized view of your app state and return the UI tree that should be shown.

The majority of your re-frame app code is written as regular functions which return data. This means that a big part of your app's development is expressing it in the terms of functions that return data so that the UI framework (React/reagent) can render it and re-frame can do the appropriate side effects.

Cycle.js is a very "pure" framework, in that it's approach is to start from first principles - pure functions, application-as-a-stream - and to layer on tools and abstractions to make it effective. The work that the core of Cycle.js actually does for you is quite minimal, and the skeleton and muscles of your application is not at all hidden from you.

Re-frame is much less "pure"; it has a guiding concept of separating your UI code from the side effects it produces. For instance, many UI functions are not pure because they subscribe to the global app state. And in fact you don't have to use re-frame for everything at all; you can opt to use local component state and direct mutation instead of that fits your use case better.

lilactown··on Minesweeper in Clojure
Lol, design is not my forte. I tried!

Btw, really great write up - I think you did a great job explaining the process of solving problems in Clojure.

lilactown··on Minesweeper in Clojure
I did the same exercise a few months ago! Using a little React wrapper I wrote for myself:

https://github.com/Lokeh/lilac.town/blob/master/src/lilactow...

https://lilac.town/games/sweeper

lilactown··on Minesweeper in Clojure
Shift-click flags the mines according to the description
lilactown··on Student-Loan Debt Is Crushing Millennials
I would say that many millennials made a decision based on information that perhaps wasn't true, and perhaps was given even in bad faith.

Source: am a millennial and experienced the huge pressure to go to college, especially an expensive one.

lilactown··on Carlo – Web rendering surface for Node applications
Yes. At least, VSCode is using monaco-editor: https://microsoft.github.io/monaco-editor/
lilactown··on Introducing Hooks
In the small world of the CLJS ecosystem, we use some very elaborate wrappers around React (for good and bad reasons). I'm excited to have many of the features we have had to implement and maintain in user land be moved into React proper, so that we can remove swathes of code that were filling in gaps in the React framework.

In general, I am much more confident in the React team supporting these concerns - simply because there's WAYYY more time, money and mindshare involved - than the CLJS ecosystem shouldering the burden.

lilactown··on Introducing Hooks
Hardly ever.
lilactown··on Introducing Hooks
Yep. It looks like React is eating Reagent's lunch and I'm super excited about it!
lilactown··on “12 years ago today, I finished writing Hacker News”
I think that just having a proper code block, that worked on mobile, would help a lot.
lilactown··on Sqlfmt: an opinionated online SQL formatter
It might be crazy, but having just gotten my hands dirty with some seriously DB programming, JDBC has a hell of a lot of value in my view.
lilactown··on [dead]
What is it?
lilactown··on Vapid: an intentionally simple CMS
A few years ago I used a small startup called 900dpi to build a few client websites that needed to allow the clients to modify certain parts of the website on the fly.

This seems similar-ish, but with a self-hosted option - which I prefer after my experience when 900dpi shuttered ;)

Seems useful!

lilactown··on Trial by Combat? Trial by Cake
I think we should just wrestle until pin or submission.

Of course, I'm a brown belt in Brazilian Jiu Jitsu, so I'm slightly biased.

lilactown··on F Natural – Putting the fn back in functional
What is it about Redux that you need?
lilactown··on Serverless Docker Beta
Sounds like what you want are Datomic Ions
lilactown··on Twitter sysadmin: “I’m deleting the Twitter app from all my devices”
It's not "disallowing discussion", it's "not giving someone a platform." The author isn't saying he wants the person not to be able to say what he's saying, but that Twitter shouldn't give him a microphone to spew his vitriol.

It certainly can be a positive thing to remove people's megaphones who are not acting in good faith, who are spreading violence and vitriol. There's almost no room for "understanding and exchange of ideas" on twitter, and definitely not what Alex Jones et. al. is seeking from the platform.

I also think that one of the biggest issues facing "understanding and exchange of ideas" in general is the idea that no one can be earnest or genuine in their outrage. Your original post used the term "virtue signaling," but even saying that the person is "throwing a tantrum" is purposefully trying to diminish the idea that the OP might be rationally upset about the events that have unfolded.

lilactown··on What Are the Differences Between Clojure, Scheme/Racket and Common Lisp?
OCaml is rough, but Clojure has quite a few nice libraries for getting up and running with a simple HTTP server - Ring is fairly simple and there are libraries and frameworks that build on top of it. Was there something in particular you found missing or struggled with?
← PreviousPage 5 of 9Next →