3,876 karma · joined Mar 28, 2019 (7y ago) · 2,562 submissions
2463.
Show HN: Typical Restarts - The third way of handling errors(github.com ↗)
2 points · by codr7 · 7y ago · discuss
comment 7y ago · link · parent
I'm not saying a more humane society would cure existing mental illness, though I'm sure it would help.
The point is that most mental illness is a product of the society we live in, and the long term solution is fixing that rather than medicating the symptoms.
comment 7y ago · link · parent
Without the immense pressure to conform to insane, abusive and destructive standards in combination with living in a harmful environment with poisonous "food" and "medicine" in competition with others who are likewise fighting to keep their head above water; I suspect most mental illness would disappear by itself.
Treating mental illness like some kind of natural law which can't be avoided, only stops us from finding the real causes and progressing towards a more humane society.
comment 7y ago · link · parent
The general idea is to stack operations and use reduce to perform the entire transformation in one go, as opposed to chaining calls to map/filter etc.
Which means first class transformation pipelines and less wasted effort among other things.
comment 7y ago · link · parent
comment 7y ago · link · parent
Yes, you can write Java using nothing but Object. And no, the experience won't be comparable to using a dynamically typed language.
Map is not terrain, if theory doesn't match reality then changing the former is the only thing that makes sense.
Categories are generalizations, making them more specific weakens them. A RISC approach works better from my experience, where categories are kept trivial and members belong to multiple categories.
comment 7y ago · link · parent
Simply making the value optional and injecting it in specified conditions if present would allow using the same construct for both.
Note that this may well be possible in P6, most things are; but I have yet to come across and example of COND-behavior, they're all switching on values from what I can see.
comment 7y ago · link · parent
Copying the idea to higher level languages makes little sense to me. Blindly copying any feature into a language design is a bad idea from my experience.
comment 7y ago · link · parent
Strongly typed used to mean safe, as in you can't add strings to ints or reinterpret values. As opposed to C and others where anything goes. I think that's a useful distinction.
Imagine all that lovely energy poured into understanding the compromises involved in designing realistic type systems. But its messy, and you don't become famous from dealing with messy problems.
comment 7y ago · link · parent
comment 7y ago · link · parent
This is sitting inside a cramped metal can with the engine in your lap and propeller in your face. There are so many ways to die in that situation that focusing on the diameter of tree trunks was just too much for me.
comment 7y ago · link · parent
That was five years ago. It felt weird for about ten seconds. These days I find code with syntax highlighting very noisy and almost impossible to deep read.
It's quite possible that it was always like this, but that I was numbed to the effects and lacked reference points.
Whatever the case, I don't miss it at all.
comment 7y ago · link · parent
Well, context oriented programming is all about separating the system into layers of behavior that may be flexibly and conveniently composed to get the right mix of functionality. Which is exactly what g-fu is doing with first class environments.
comment 7y ago · link · parent
We already had email more or less, at least in ways that mattered. And the experience was non-commercial and personal, with operators putting a lot of time and effort into their quirky online worlds.
Some of it's still around if you go look for it, but I can't shake the feeling that we lost something worth keeping.
comment 7y ago · link · parent
It's a nice compromise. The emit-logic can be kept fairly uniform and low-maintenance since its more or less identical to the regular interpreter.
I got around 10% increased performance on a Forth in C for whatever that's worth.
One thing to keep in mind is to use functions in the emitted code rather than simply dumping everything in a pile. Most compilers don't deal well with code piles from my experience , which makes the code both compile and run slower than it could.
comment 7y ago · link · parent
And I'm pretty sure whatever is in there isn't worth the hoop jumping so it doesn't look like a great short term strategy either.
Ignoring sites that push this crap is effortless and very effective.
comment 7y ago · link · parent
The Clojure-code I've written, while terse; always feels too far off from what I want to say. I have the same issues with Haskell, too much hoop jumping to take part in someone else's quest for purity.
There's plenty I like in there and Rich is a very disciplined thinker. The languages have much in common. g-fu's way of using environments looks a lot like Clojures use of maps if you squint.
Transducers are brilliant, it's difficult for me to believe it took this long. Which is why g-fu uses [0] them as the foundation for all sequence transformations.
[0] https://github.com/codr7/g-fu/blob/master/v1/lib/iter.gf
comment 7y ago · link · parent
[0] https://github.com/codr7/g-fu/blob/master/v1/src/gfu/abc.go
comment 7y ago · link · parent
The main idea behind G-Fu is to complement Go by providing a more expressive experience while delegating the heavy-lifting. Which means that performance is far from the top priority.
comment 7y ago · link · parent
I've written my share of Forths, but none in Go. Lisp is definitely more involved, especially expanding macros and juggling environments.
You're welcome :) Note that I'm still in the process of simplifying and refactoring quite heavily. Feel free to get in touch if you run into anything weird, and I'll do my best to help make sense of it.