Readit News logoReadit News
daliwali commented on Feature Flags: Theory vs. Reality   bpapillon.com/post/featur... · Posted by u/benpapillon
daliwali · 2 years ago
At my work, I have a somewhat clever (or idiotic) technical solution to the problems of feature flags: they are actually implemented as feature modules that monkey-patch the base application in runtime.

There are a few benefits: removing features is dead simple, just delete the whole feature module, and there's no conditional branching in the base application.

There are some drawbacks too: the base application must have entry points for the feature modules to overwrite. Usually the default values are no-op or some default behavior. Features also must implement setup and teardown, which can take longer to write than a conditional.

daliwali commented on Show HN: Dak – a Lisp-like language that transpiles to JavaScript   daklang.com/... · Posted by u/daakus
daliwali · 3 years ago
Really reminds me of Parenscript[0], which is a subset of Common Lisp that transpiles to JS with no runtime. It's basically a thin skin around JS and it feels more like writing JS with a Lisp syntax.

What I feel is missing from Parenscript is runtime macro-expansion, hard to do without using JS to build the AST.

[0] https://parenscript.common-lisp.dev/

daliwali commented on Show HN: A an R7RS Scheme Implementation in WebAssembly   github.com/PollRobots/sch... · Posted by u/pacaro
raphlinus · 4 years ago
Interesting! Was there anything that you think came out significantly better than if you had written it in, say, C or Rust?
daliwali · 4 years ago
If I had to guess, it's because the WebAssembly Text Format is S-Expressions, similar to the target language, Scheme. Also, less tooling involved to build the binary, since the text format is pretty close to the binary format.

In practice though, it looks closer to C/ASM. The author even wrote comments in C. This is the first time I've looked at an actual program written in the wasm text format and it's pretty interesting to see how one would actually use it. Very neat.

daliwali commented on Show HN: S² is a function for reactive web UI   gr0uch.github.io/s2/... · Posted by u/daliwali
quickthrower2 · 4 years ago
This feels a lot like KnockoutJS's observables (but using proxies I guess so the code looks neater). Is it much different to that. Am I missing something?
daliwali · 4 years ago
I've never actually used Knockout but I guess it looks vaguely similar.

s2 has the advantage of being much smaller (a little over 2kb compressed), and faster on benchmarks[0] and probably real world performance. The API tries to get out of your way as much as possible. The dependency tracking is seamless by using Proxy.get trap. There's no forced separation of models or views, it's all data.

I wrote it because I had to make a complex UI with streaming WebSocket data work smoothly.

[0] https://krausest.github.io/js-framework-benchmark/current.ht...

daliwali commented on Babel is used by millions, so why are we running out of money?   babeljs.io/blog/2021/05/1... · Posted by u/Ashoka_rkt
daliwali · 4 years ago
Open source is not a business model, and I think the expectation to get paid for open source is a bit disingenuous. There is also the ideological aspect of free as in freedom licensing, while it doesn't exclude monetization, often detracts from the incentive to pay for software.

To play the devil's advocate, I would suggest that there is price discovery at play here and people + corporations are willing to pay for what they get value out of. Which is suggesting that many companies don't get much value out of Babel or it is one of many tools utilized in a toolchain. The value proposition is to be able to run new JS in old JS runtime, which may be less valuable now than it was 5 years ago, since evergreen browsers exist and outside of stale corporate environments, most browsers are auto-updating now.

daliwali commented on Show HN: A ~2kb metaprogramming function that maps data structures to the DOM   github.com/gr0uch/s2... · Posted by u/daliwali
gigatexal · 5 years ago
Is there a bug in the trivial example? I can't seem to follow how it's referencing one template and another in the function. But I am not a JS dev so perhaps I am just missing something.

This looks neat tho.

daliwali · 5 years ago
the root template references the other one with data-template=“#countbox”. this allows for composition and re-use of templates.
daliwali commented on Show HN: A ~2kb metaprogramming function that maps data structures to the DOM   github.com/gr0uch/s2... · Posted by u/daliwali
chovybizzass · 5 years ago
looks cool i've been using svelte a lot and find it to be great, although I do not like all the upfront code you have to load for a hello world app.

If this gets more features I can see it being a contender.

daliwali · 5 years ago
It is pretty much feature complete already, there are only so many fundamental operations and DOM attributes. besides, I would like to keep it around 2kb ;)
daliwali commented on Show HN: Dating Site Without Pictures   ohmyperson.com/... · Posted by u/gieoon
daliwali · 6 years ago
Hahaha this will never work for an obvious reason that isn't socially acceptable to state. As soon as looks get involved, it's over.

u/daliwali

KarmaCake day653June 6, 2012
About
hackin'

[ my public key: https://keybase.io/daliwali; my proof: https://keybase.io/daliwali/sigs/3Lrc-Ncfpmax3oBV7RHTvXUTQGHcsLFbWov2iTjIYxY ]

View Original