Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
MrJohz
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
44 ms
·
631.
▲
by
MrJohz
3y ago
I found fish + fire = sushi amusing - it isn't necessarily wrong, but it also doesn't feel right either...
632.
▲
by
MrJohz
3y ago
Ah, I see what you mean. I guess it's a matter of framing - to me, choosing to install and run Typescript is the equivalent of choosing to install and run mypy - in both cases, you've added an additional tool above and beyond the
633.
▲
by
MrJohz
3y ago
It's possible to introspect type hints at runtime, in the same way you can inspect e.g. a function's name or parameters. However, there is no built in way of using these type hints as a runtime-enforced check. There are a handful
634.
▲
by
MrJohz
3y ago
I'm not sure that's really a practical distinction between Typescript and Python. Most of the practical bundling setups I've seen use a tool like Babel or Esbuild, which doesn't do any type checking - instead the type ch
635.
▲
by
MrJohz
3y ago
At least when I was learning Python (which admittedly is over a decade ago at this point), there was a lot of that passion for Python and what made it great - you'd get things like the Zen of Python quoted, there was the "import a
636.
▲
by
MrJohz
3y ago
When I removed the type checking stage, that was with Pyright, which I'd used because of these sorts of recommendations. It has some advantages over Mypy, sure, but it still ended up being more hindrance than help. Particularly with th
637.
▲
by
MrJohz
3y ago
Yeah, I've recently removed type checking in a Python project because it was causing more false positives than true positives, and working around the type checker's complaints was just getting too tedious. I'm a big fan of ty
638.
▲
by
MrJohz
3y ago
Devcontainers are amazing for getting a consistent environment set up on multiple computers on multiple operating systems. I was in this situation recently with a new colleague who was using a very locked-down Windows computer, and it was r
639.
▲
by
MrJohz
3y ago
Yeah, I noticed while writing Typescript that it was suggesting `String` above `string`. In Javascript and Typescript, there are almost no situations where `String` is the correct thing to use, so this choice surprised me. I tried it out to
640.
▲
by
MrJohz
3y ago
Servo had a period where it had no active backing, but now it's part of the Linux Foundation and seems to have more buzz around it. I know Tauri (UI toolkit for Rust and other languages) are looking at ways to use Servo as the backend
641.
▲
by
MrJohz
3y ago
That's true, which is why it's now being stripped.
642.
▲
by
MrJohz
3y ago
In fairness, this is just doing something automatically that you could have done manually anyway. It's a good change because defaults matter, but it's always been possible to strip debug symbols from Rustc-generated binaries, and
643.
▲
by
MrJohz
3y ago
Any large program is composed of libraries. They may not explicitly be described as libraries, or imported from external sources, but there will be abstraction boundaries somewhere. Which means that if you're writing a program, you pro
644.
▲
by
MrJohz
3y ago
I think I might be missing something from that article, but I don't think they're in so much disagreement with Ousterhout. Ousterhout's core argument is this: consider a module as its interface (measured, say, in # of edge ca
645.
▲
by
MrJohz
3y ago
It isn't required, but create-react-app (CRA) is designed as a kind of kitchen sink toolkit that includes a lot of things that you might not need now, but could need later. For example, while it doesn't include Typescript directly
646.
▲
by
MrJohz
3y ago
I think the loss of these tools has less to do with the death of flash, and more to do with the decline of the genre of "internet ugly" cartoons and free games as a whole. We have technology in the browser that is just as powerful
647.
▲
by
MrJohz
3y ago
What would you see as the big benefit of array languages over simply array-based programming in other languages? Or in other words, what sorts of things will I learn from trying out J or APL, that I wouldn't learn by playing around w
648.
▲
by
MrJohz
3y ago
Wix is not a state-run company, is it? It seems reasonable to me to be able to distinguish between "Israel, the government/state" and Israelis.
649.
▲
by
MrJohz
3y ago
I only worked briefly in software for research, and what you described matched my experience, but with a couple of caveats. Firstly, a lot of the programs people were writing were messy, but didn't need to last longer than their curren
650.
▲
by
MrJohz
3y ago
The problem with models is that once you've come up with a mental model, you will make assumptions about what happens when you do certain actions based on that model. And even if your model is very good, there will pretty much always b
651.
▲
by
MrJohz
3y ago
This is generally how I feel as well - CSS is really powerful, but also a lot simpler than it used to be in many ways, and to me it makes sense to lean into that. That said, I find the tooling for CSS modules tends to be fairly dire - type
652.
▲
by
MrJohz
3y ago
That's mostly the point I'm trying to make! What would you see as a more convincing example of TCO in this context?
653.
▲
by
MrJohz
3y ago
To be clear, I'm not talking about PTC/TCO in general in this comment, I'm talking about it specifically in the context of Javascript, and in the context of the common patterns of Javascript usage. That is, PTC doesn't j
654.
▲
by
MrJohz
3y ago
In Haskell, all functions are syntactically and semantically curried. That is, a function that takes two arguments is essentially identical to a function that takes one argument, and returns a new function that returns a second argument. (I
655.
▲
by
MrJohz
3y ago
I don't think it's the lack of TCO that's the thing holding JS back from getting the next great functional language. There's no structural pattern matching, there's no immutable data structures, there's nothing
656.
▲
by
MrJohz
3y ago
I agree that TCO is essential in functional languages where loops and mutability are disallowed or at least heavily discouraged, but Javascript is not one of those languages. In Javascript, both mutation and and loops are very simple, and a
657.
▲
by
MrJohz
3y ago
TCO isn't really an optimisation per se, at least in the sense that optimisations typically aren't observable as part of the semantics of a language. TCO does affect the semantics; it says that a recursive function that recurses o
658.
▲
by
MrJohz
3y ago
Firefox have also chosen not to implement it, right? Indeed, my impression was that Firefox were far more against the whole thing than Chrome, who did implement TCO but then removed it for various reasons. My impression is that this is less
659.
▲
by
MrJohz
3y ago
I think this article actually does a really good job of explaining why TCO hasn't really been an important part of the JS ecosystem. There's a lot of situations where recursive algorithms are really neat and clear. I don't kn
660.
▲
by
MrJohz
3y ago
There's an argument to be made for writing functions like `isEven` and using them instead of n%2. There's an argument that the JS standard library, or other comprehensive util libraries like Lodash or Underscore should include the
More ›