HNHacker News
TopNewBestAskShowJobs

lilactown

849 karma · joined September 2, 2015

submissionscomments
lilactown··on Schism – A self-hosting Scheme to WebAssembly compiler
I just got my whole team to switch to Clojure(Script), so... ;)
lilactown··on Announcing Flutter beta 1: Build beautiful native apps
I'm still on that Clojure(Script) hype train TBD. A few years later and I feel like I'm almost where I want to be in terms of productivity.

Prepare for the ReasonML hype train though - which I am also on! :P

lilactown··on DigitalOcean begins CEO search
As I've begun building a new personal project, I wavered between using DO, AWS & Heroku.

I started with Heroku, and immediately ran into annoyances - mainly that they treat git as the source of truth, and require anything else to be injected as environment variables (which I find annoying).

AWS was tempting, since we use it at work, but the complexity of configuring what I needed was more than I wanted to deal with.

So I went back to DO (who I already run a couple VPS' with) and cleared off a droplet that I wasn't using, setup a docker droplet and went on my merry way.

lilactown··on A Clojure learning journey
I think everyone goes through this when they're newish to clojure - it's a recognized deficiency in the ecosystem, and one that needs to be solved sooner than later.

However, I will say that once you "pick your poison" and get used to a specific workflow, it becomes vastly easier. The same set of tools work for pretty much any kind of project.

Stuart Halloway gives a great talk[0] where he drunkenly expounds on the importance of REPL driven development and explains his workflow. Honestly, this changed the way I work day-to-day for the better and helped me realize the power that tools like Emacs and Cursive give you; specifically, in-editor evaluation of forms.

For me, I use leiningen for building/dependencies and Emacs/CIDER for my editor. Another good choice is Cursive. Then split it up by what runtime I'm targetting:

Clojure/JVM: - mount for state - ring for HTTP services - clj-http for HTTP requests

ClojureScript/JS: - shadow-cljs for building (with lein integration) - mount for state - macchiato for HTTP services - cljs-http for HTTP requests - reagent for UI

These tools & libraries cover about 80-90% of what I need in a new project, and everything after that is specific to the use case.

Wading through one or two self-contained projects goes a long way into helping you figure out your workflow, and afterwards it's just applying it.

My hope is that in the near future, a lot of the initial friction will be wicked away from the tooling and people will be able to get spun up much faster. Advanced Clojure workflow is a very different way of developing software than most people are used to, though.

[0]: https://vimeo.com/223309989

lilactown··on Promises are not neutral enough
The author is the original author of the streaming library xstream (similar in functionality to RxJS) and Cycle.js.

I believe he's thought a lot about this problem.

lilactown··on Promises are not neutral enough
The way that promises are implemented actively hurts the ecosystem. Trying to e.g. create a sound typing of the Promise API is really, really hard because of it's auto-flattening nature. This severely hampers languages like TypeScript, Flow & ReasonML that build on top of JavaScript.
lilactown··on Promises are not neutral enough
He literally talks about the work-arounds you can use to delay the function call in the article, and explains why you would prefer it to be default behavior.

Error handling is annoying, and this is (eventually going to be) fixed in Node.js. In the browser, you can add some listeners: http://2ality.com/2016/04/unhandled-rejections.html

lilactown··on Exploring ReasonML and functional programming
It depends. IMO Cojure is a much more mature and stable foundation for building apps today - ReasonML is a good bet for the next 5 years, though.

My team recently weighed Clojure(Script) & ReasonML and chose Clojure, because we need to ship and it's not going anywhere.

lilactown··on The Kubernetes Effect
100% agreed. A lot of the cloud computing products are simply re-implementations of what was created in the Erlang/BEAM platform, but more mainstream languages. IMO it's cheaper to invest in learning Erlang or Elixir than investing in AWS/K8s/etc.

Elixir and Erlang are basically a DSL for building distributed systems. It doesn't remove all of the complications of that task, but gives you excellent, battle tested, and non-proprietary tools to solve them.

lilactown··on "Principles of Adult Behavior" by JP Barlow
As someone who enjoys training Brazilian Jiu Jitsu, I choose to take it non-literally.
lilactown··on Reason ML toolchain
He's saying Reason = OCaml. OCaml can be compiled to to either a native executable, native bytecode, or JS.

His comment may sound like a bit of an non-sequitur, but really the confusion comes from: it's not a delineation between OCaml and Reason, but native packages vs. packages that are designed with JS interop in mind.

Some native packages can be compiled to JS (e.g. if they don't rely on C FFI), but many interesting ones cannot. js_of_ocaml's version of this story is much better than bucklescript's, but honestly I haven't explored it that much in either one.

So what you're saying - write pure OCaml/Reason code, with some JS interop, without relying on native OCaml/Reason packages - is certainly possible! And is probably the most common way of writing apps using the ReasonML syntax today.

lilactown··on Deploying a ReasonML React app with Docker
I think that configuring jbuilder/etc. can be a point of friction for people coming from bucklescript, so bsb-native provides the same workflow for native compilation.
lilactown··on Reason ML toolchain
I understand what you're saying. Many native OCaml libs are not portable to JS, and you definitely can't port a JS lib to OCaml with the current toolset, which prevents the dream of being able to not care at all about runtime. It's the same dream I've been chasing on the Clojure(Script) side lately as well.

I believe you can get close in ReasonML by making a clear distinction between client (JS) and server (native), and then maintaining a common module of business logic and utilities that you would want to share between the two. This works well up to the point where you want to server-render some HTML, at which point you become sad because you'd love to use the nice ReasonReact component abstraction, but it is not at all portable to native.

Jared Forsythe has been doing a lot of work on making portable applications and libraries in ReasonML, and I do believe that the native compilation story will receive enough love that more people start taking it more seriously - right now the majority of time + energy of the ReasonML team seems to be focusing on honing JS application development, so most of the community is orbiting that use case.

lilactown··on 25 Days of ReasonML
ReasonML is pushing hard on the "it's a better JavaScript" angle, which has a lot to do with it's popularity at the moment. In that regard I think it will be an easier sell than F# as ReasonML grows in maturity.

Part of the problem with adopting an ML is that it feels like a huge departure from mainstream software development. From the syntax, to the build tools, to the concepts one uses on a day-to-day basis, it can be hard to slog through to get to the point of feeling productive.

ReasonML is focusing on four things to help alleviate this friction from adoption:

1. Providing a more familiar syntax

2. Providing simple, high quality tooling built on top of a familiar ecosystem

3. Providing high quality documentation that focuses on onboarding developers who are coming from these other ecosystems

4. Providing a "killer-app" that can show the power of the language and draw peoples interest - in this case, Reason's integration with React through it's ReasonReact library and support for JSX.

I think that these 4 things really make a difference when getting "people onboard with an ML," which is why the ReasonML community is something that I'm betting on for the mid- to long-term future.

lilactown··on 25 Days of ReasonML
I ran all of my Advent of Code[0] solutions in Node.js - there's nothing specific really about running a ReasonML app in Node.js vs the browser. Except you don't need a module bundler for the former. :)

I've also been slowly working on a small CLI app using ReasonML, ReasonReact and react-blessed.

There definitely is a dearth of ReasonML server-side examples, libraries and frameworks, though - especially compared to all the front-end chatter. bs-express[1] is actually quite nice, but hasn't seen much attention from the larger community. I would highly recommend it if it's something you're interested in pursuing.

[0]: https://github.com/Lokeh/advent-2017

[1]: https://github.com/reasonml-community/bs-express

lilactown··on 25 Days of ReasonML
There are definitely individuals exploring the native-compilation story, for instance bsb-native[0] allows BuckleScript to use OCaml's native compilation tools. Jared Forsyth has also been publishing a lot of material[1] about creating cross-platform project using ReasonML.

The ReasonML team seem to be taking a conservative approach towards what they officially release. They want to make sure that they have a really good plan on how and where to move forward with each of these stories - async, native compilation, cross-platform project, optimizations, etc. Right now they seem to be focusing on creating a really high quality platform for building front-end web applications, but all of these things are on their mind.

I'm actually reminded of the fact that Jordan Walke (initial creator of React) is currently working on a native OCaml/Reason package manager called esy[2], which in my mind is kind of the starting point of the native compilation story: unifying the package and build system of the two ecosystems.

[0]: https://github.com/bsansouci/bsb-native

[1]: https://jaredforsyth.com/

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

lilactown··on 25 Days of ReasonML
Hey, author here!

I definitely agree that Promises - and the whole async story in ReasonML - is pretty poor atm and ripe for improvement in the near future. I'm not sure what you mean by, "remember to resolve them," though?

I've helped Wojtek Czekalski out a bit with a small library called vow[1] that provides a more type-safe way of using Promises in BuckleScript/ReasonML - it needs a bit clean up (update to new syntax, publish to npm) that I might do in the coming weeks. Nick Cuthbert has a PR for making it completely sound[2] that might land soon as well, which might change the API but provide even more safety.

[1] https://github.com/wokalski/vow/

[2] https://github.com/wokalski/vow/pull/6

lilactown··on 25 Days of ReasonML
Hey, author here!

BuckleScript itself doesn't actually do any sort of bundling or minification of the code - in fact, it prides itself in generating "human readable" code that, worst comes to worst, one could modify by hand and not be too hung out to dry.

So in that case, you are at the mercy of the general JS ecosystem when it comes to module bundling, minification, code splitting, etc.

The Google Closure compiler does a lot of the magic behind ClojureScript's advanced optimizations, so theoretically one could leverage those same optimizations with an app compiled by BuckleScript. Unfortunately, I don't have any real-world experiences with this.

However, I do have experience using ClojureScript + Google Closure compiler and can give you a heads up that you might (...probably will) run into issues using Closure compiler with NPM libraries, which the BuckleScript ecosystem relies on.

As someone who recently started working daily with ClojureScript, I'm really crossing my fingers for some of rough edges around Node.js/ES module support in the Closure compiler to be smoothed out soon!

NINJA edit: I have heard good things about rollup with regards to dead-code elimination and other optimizations, but the JS module bundling story is moving at break-neck speed these days and I'm not really keeping up with it - Parcel's a new thing? Jaredly's writing a bundler in ReasonML?? X_X

lilactown··on The Eve programming language project is winding down
This is really awesome! Even better, it introduced me to Clara.
lilactown··on How I review code
IMO, we should focus more on standardizing on runtimes rather than language. Languages evolve, and new ones come out that solve problems better. We luckily live in an age where many of those languages can interop at the runtime level.

As a developer, and as a team, it sucks to be told "you must use Java and JavaScript for time immemorial." An easy compromise is that any package/library/service/etc. must target the JVM or JavaScript VM and provide interop with existing code.

lilactown··on Go Is a Great Fit for Lambda
I have to imagine there is a business reason for the slow adoption of languages/runtimes in Lambda. They're still only supporting Node v6.10 as well, which is far outdated. They should at least be keeping up with LTS for security sake.

Before releasing Go support, it felt like they're simply creating arbitrary friction to keep people on their platform. By expecting your code to export a handler, rather than listen on a port, that has a specific signature, you end up coupling yourself more to the AWS platform. But it also causes a ton of friction for adoption, since testing is more difficult than it should be.

Now with the release of Go, it feels even more that they're putting up these arbitrary gates without a rhyme or reason. How come Go can listen on a port, but other runtimes need to export a handler function? Why did they choose to rely on a Go-specific protocol instead of a common one?

It's frustrating, because I really want to use it (from an ops perspective), but I think my team is going to ditch the proof of concepts we've done because of the friction we've experienced. I'm sure there are valid engineering reasons for these choices, I just don't see them.

lilactown··on Perl 6 Advent Calendar
I now want to try writing web-sonnets using Perl 6's grammar...
lilactown··on Type-safe GraphQL with OCaml
You're right in that ReasonML syntax is a bit of a moving target, but I think it's part of the initial pains of their effort to provide an approachable port into the ML world. The syntax should stabilize eventually. The maintainers are aware of the churn they are creating, and have deemed it worth it.

That being said, I have a bunch of old projects written in Reason 2 (which still work; the tooling has preserved perfect backwards compatibility[0]), and recently started a new project using the new Reason 3 syntax. It was easy enough to pick up the new syntax in about a day. I haven't done it yet, but my understanding is that it's completely automated[1].

[0]: https://reasonml.github.io/community/blog/#reason-3

[1]: https://github.com/reasonml/upgradeSyntaxFrom2To3

lilactown··on Type-safe GraphQL with OCaml
I do miss a lot of the parentheses-less-ness of OCaml (and the old Reason syntax), but I'm honestly a lot more comfortable at least broaching the topic of using it on some work projects now that it's more JavaScript-y.
lilactown··on Type-safe GraphQL with OCaml
I'm hoping the movement around ReasonML[0] could lead to both the web community being able to reap the benefits of OCaml's fundamentals, while also giving people a point of introduction to the OCaml community through web dev.

It has been my experience that the ReasonML community is incredibly welcoming to new comers, and is moving at a break-neck pace to find the right target of being approachable for people who are familiar with JS, but also empowering users to use all of OCaml's power to create web apps that are more simple and correct than they would otherwise be.

[0]: https://reasonml.github.io/

lilactown··on How to Get Rich Playing Video Games Online
Likewise, I watch almost exclusively Firebat (with a bit of Kibler every once and awhile).

He does a really good job of balancing being funny and interesting (as a person), and giving really good insights into his thought process in playing Hearthstone, building decks, and competing.

lilactown··on Coders of the world unite: can workers curb the power of Big Tech?
You had the opportunity and means to do so. That's a privilege many are not afforded, due to various circumstances.

Privilege isn't a bad thing. Acknowledging it shouldn't take away from the fact that you had to work really hard, maybe harder than many others, to get to where you are.

lilactown··on Reason 3
You can provide your own type guards: https://www.typescriptlang.org/docs/handbook/advanced-types....

Doing this in the general case, I assume, is probably not practical.

lilactown··on Reason 3
Bug reports are a way to measure how well the behavior is approaching correct. You seem to not be satisfied with messenger.com's experience; valid, it seems. It's a large app with bugs. But your point is obscured by the fact that you seem to be poo-pooing one of the few ways that the development team can get feedback on what users actually experience on a day-to-day basis.

chenglou is doing a bit of massaging of the numbers; the claim that there's "only been 10 bugs" isn't quite true. Their code base is 50% ReasonML and 50% JS, and in the ReasonML portion, they've only had 10 bugs - a signification reduction! But they haven't commented on how many bugs are reported in the JS side; we can probably infer that there is many more (since the implication is that there were many more bugs in the old JS code they replaced).

You seem to be frustrated that the messenger.com experience is not up to par and have latched on to the idea that, since the team says they're seeing improvements since introducing ReasonML, that they think they're perfect now. I guarantee you that's not the case.

It sounds like you have some very valid complaints, though, and as a daily user I bet they'd love to hear your feedback. So maybe fill out a bug report with what you just wrote? :)

lilactown··on Clojure/Conj 2017 – Opening Keynote by Rich Hickey [video]
I think it's something else, as well. Rich even mentions it in his talk: languages like Java (which I'm reading to mean "statically typed") are great at mechanical tasks. Front end programming is mostly filled with mechanical tasks: scaffold this structure/layout. Wire up these events. Make this thing blue/bold/etc. Change the state when these events happen. It's fairly predictable in structure in line-of-business apps, at least once you're following an intelligent structure, e.g. the Elm architecture.

UI/Front end dev, IMO, can gain quite a bit from static typing. I'm a huge fan of clojurescript, it's what I reach for whenever I want to work on something, but I'm super excited about ReasonML for the future of my team; we struggle with our JavaScript code base right now due to the lack of imposed structure and feedback for our weaker developers.

I love Clojure and I think it makes sense in a lot of domains; most of my back end development is "take this data, transform it according to some nebulous business rules, and poop it out to some other place," which Clojure is amazing for. It's great for applications that don't require a lot of "wiring", and require a lot of "flow". UI programming is, for the most part, wiring things up. It's not that Clojure/Script is not up to the task (I think e.g. re-frame, and the stuff being done with Fulcro, is amazing) but I definitely see the benefits of static typing more in that domain.

And like Rich said, if you're doing UI it will usually completely dominate the problem space you're working in. So pick the right tool for the job. I'm not convinced TypeScript is the way exactly, but like I said, ReasonML and Elm are super promising.

← PreviousPage 7 of 9Next →