Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
spion
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
102 ms
·
931.
▲
by
spion
10y ago
If you can stomach a little build tool complexity (a one-time cost), React + MobX is basically a better, simpler Vue.
932.
▲
by
spion
10y ago
I also forgot: Its not just about raw HTML: this might need to be a totally custom template with data bindings to other data. Here is an example, the spinner's promise provides the data for a dropdown component which in turn is bound t
933.
▲
by
spion
10y ago
Nice try, but I expect that the template is contained within the app template (or really any other template), i.e. `<spinner promise=promise> <inner template parameterized on data here></spinner>`. I don't want
934.
▲
by
spion
10y ago
How about components that you need twice on the page? Are you going to just include them and their JS twice? Or perhaps build an elaborate server-side module system, one in which components required multiple times are only included once at
935.
▲
by
spion
10y ago
Its not just the speed. Have you looked at ES6 code? You will see a modern language with all the bells and whistles, including classes, lambdas, coroutines, template strings, a few other sugary features and a python-like module system. All
936.
▲
by
spion
10y ago
Depends on what you see by "largely unique". Do you have a spinner while you wait for data to show up on each page? Then you might have a common spinner component. Of course, you could also re-code the spinner every single time. O
937.
▲
by
spion
10y ago
Right. CommonJS is great, I actually like it more than ES6 modules. But even with CommonJS you still need the bundler and the build step. You can get data binding in React with MobX, which pretty much gets you on par with Vue: https:/
938.
▲
by
spion
10y ago
No, only if you plan on writing any reusable components. Which is sort of the point of any framework. Well, unless you plan on writing all your code in one file (likely painful), or using an async loader (either slow, or painful because of
939.
▲
by
spion
10y ago
I think Swift got almost everything right, except for not having a GC maybe. Especially everything related to exceptions: the combination of "throws", "defer" and "try"/"try!" gets rid of most of
940.
▲
by
spion
10y ago
> If you add a new type to a sum type in a statically typed language, that's a breaking change for all downstream consumers. Not true, consumers that have an explicit "catch-all" pattern at the end will work normally
941.
▲
by
spion
10y ago
Not really. You don't have typescript's typechecking for templates. You don't have higher-order components or first class components. Scoped slots are almost there, but not quite. Also, "scoped slots" show that vue&
942.
▲
by
spion
10y ago
Right. You need inferno-compat as a drop-in replacement for react, as well as mobx for all the other vue features. The payload for that would be similar to vue: 15KB min+gzip for mobx + 7kB for inferno-compat + 4kb for mobx-react = 26KB min
943.
▲
by
spion
10y ago
The thing is, in any real project where you need a front-end framework, you will need modules very soon. And once you need modules, you need a bundler, which means you need a build process. While you are building, you might as well take adv
944.
▲
by
spion
10y ago
The perceived upfront cost is lower with Vue. You can just put it on the page and voila, you have observables, computed properties, templates, everything. No webpack, no transpiling, no modules, no npm. This is also how angular got popular.
945.
▲
by
spion
10y ago
"JavaScript is the worst tool". Ah, no matter how many times I see it, it never fails to rub me the wrong way for some reason. Its faster than Ruby, Python and PHP by a mile. It now has async/await. The amount of work that go
946.
▲
by
spion
10y ago
> why do other languages that are arguably JavaScript competitors, like Ruby and Python, not have the same wide selection of alternate syntaxes and sugar packets? Could it have something to do with the usability of the default dialect? P
947.
▲
by
spion
10y ago
The main argument here apparently is "lets not add safety features because we have a limited pool of features before the language becomes too complex". I don't think thats a convincing argument. Its a question of which featur
948.
▲
by
spion
10y ago
Yeah, I imagine all those distortion and amp units introduce a lot of fairly loud random noise.
949.
▲
by
spion
10y ago
Take the word "soon" in your example. How many unambiguous meanings does it have? We may be overestimating our success in communication. Heck, I'm not even sure if my understanding of soon equals yours. Is it a century, a few
950.
▲
by
spion
10y ago
One of the tricks I like to use to get up to speed quickly is making a hyperlinked dictionary / glossary (a wiki or a github page with anchor links work nicely). The biggest roadblock to understanding the code you read is not knowing t
951.
▲
by
spion
10y ago
On the frontend: React, MobX, TypeScript TypeScript, because its a fast compiler and has the best typechecker support and typings collection for existing front-end libraries, so there is almost no need to wrap anything. React, because its c
952.
▲
by
spion
10y ago
Which only goes to show that you can't apply real world reasoning to explain an academic concept. In this purely theoretical concept, World (which cannot be inspected) does contain the entirety of the world, including all other actions
953.
▲
by
spion
10y ago
I find it more interesting that this program has a bug even though there are just two pieces of code, not more than 10 characters apart that modify only one shared mutable integer.
954.
▲
by
spion
10y ago
do notation is not cheating - I would not avoid it. IMO its important to share awareness that Haskell can do procedural, imperative code just fine and even has nice sugar for it.
955.
▲
by
spion
10y ago
Ok, I'll put it this way: Saying > when you call "print", it returns a "new world" that is the state of the world after printing makes no sense, since the word "state of the world" will be interpreted c
956.
▲
by
spion
10y ago
That assumes there is only one program running in the world. Its simply not clear what the "world" type means. Its a bad name. I'd rather go ahead and explain it as a token.
957.
▲
by
spion
10y ago
Okay. Please replace all Maybe instances in your code with Arrays and let me know how that goes.
958.
▲
by
spion
10y ago
Thats not the issue here. Even if the functions themselves are pure (beyond the act of creating a promise), the strictness of promises together with their micro-task queue rule impose execution ordering that make them a non-monad. So its im
959.
▲
by
spion
10y ago
Its just that when you mention this, the assumption is that "World" is the state of the world. Which is not true, since world is just a token to impose ordering of execution in a lazy language, but its a fake state token since its
960.
▲
by
spion
10y ago
The "world" equivalence is not a useful way to think about it. A more useful description would be a tuple that contains two items, the first one being the description of the action to execute, and the second one being the function
More ›