Better HN
topnewbestaskshowjobs
Log inSign up

codr7

3,876 karma · joined Mar 28, 2019 (7y ago) · 2,562 submissions

codr7@protonmail.com
Submissions

comment 7y ago · link · parent

Trust me, there's nothing simple about taking this stance and pointing out the big elephant in the room.

Blaming chaos or genetics, that's how you over-simplify.

comment 7y ago · link · parent

I mean most, that's about as specific as it makes sense to be since the definition keeps morphing to hook an ever growing part of the population into the profit-machine.

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

You are missing the point.

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

Most mental illness is definitely society's product.

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

While we're on the subject of reduction, I really think transducers [0] deserve a mention.

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.

[0] https://clojure.org/reference/transducers

comment 7y ago · link · parent

Thanks, I have yet to come across anything that P6 doesn't have a feature for. The languages [0] I've designed so far don't even come close in complexity, and I'm still balancing the edge of my abilities to keep track of everything. If they manage to make that monster run reasonably correct and fast, I'm seriously impressed.

[0] https://github.com/codr7/g-fu/tree/master/v1

comment 7y ago · link · parent

Wow, had no idea about fallthrough in Go and I've written plenty. Thanks.

That's a seriously ugly solution, but I guess that could be considered a good thing.

comment 7y ago · link · parent

I don't know enough Haskell or Rust to claim its impossible (outside of unsafe of course), but it clearly goes against the design of the language and is meant as fallback more than option.

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

I'm usually looking for two kinds of switching, most implementations support one of them. Switching on a list of conditions in priority order like CL's COND, and switching on a value.

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

Falling through sort of makes sense in C, which is underdefined by design to allow pulling whatever dirty tricks needed to get where you're going.

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

So what you and Harper are saying is that Python only has one static type? While that is sort of true, I can't see how its leading anywhere. Many static languages have no dynamic types, I think that's worse.

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

It's difficult to pin-point these things, especially from the inside. I have Psoriasis since 30 years back, which in turn has something to do with a stressed immune system, which in turn depends on intestinal and stomach health. Drinking the healing soil improves the condition a lot for me, as does dissolving it in oil and rubbing into the skin.

comment 7y ago · link · parent

You're joking, but in Germany you can buy several different grades of so called healing soil for different uses in many regular super markets.

I take a tea spoon dissolved in water about once a week, which seems to help my system work more smoothly.

comment 7y ago · link · parent

I once got around two thirds through a certificate for flying ultralight planes. It sort of stopped making sense to me when we were practicing emergency landings over forest and I was told to aim for trees with thinner trunks.

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

I used to swear by syntax highlighting, but then I tried turning it off after hearing of someone else who tried and never went back.

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

How so? I get that going the route of Python and Lua and using a general purpose data structure for the environment isn't optimal. But g-fu exposes the already existing environment as a separate type, the only thing it knows how to do is map symbols to values and access is restricted to a few special forms just like any regular Lisp enviroment.

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

It took me several years of exposure to see the point of the internet. I had been running my own BBSes for quite a while by then.

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

That was my point, most of them aren't even trying.

And the posted link seems to be one of those.

Just wanted to note that its not really comparable to what g-fu is doing.

comment 7y ago · link · parent

Thanks.

It's very shallow though, more demo toy than practical tool like most Lisps.

comment 7y ago · link · parent

Yeah, so I heard.

I have yet to try plugins myself, but I've implemented the same mechanism using dlopen in C.

I'm almost hoping that big G is forced by greed to include Windows. Otherwise some kind of shim on top of DLL-loading might be an option.

comment 7y ago · link · parent

Yep yep, we're talking about the same thing. I like to call it an inline interpreter.

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

Not a very long term solution if you ask me, that will stop working as soon as possible.

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

I find Clojure refreshing, but it has too many agendas for me and Java is just (a) no Go. I tried, I did. And launching the repl felt like watching grass grow on my latest/greatest macbook. And if I'm going to use a Lisp in Go, I definitely prefer one designed around Go to one imported from Java.

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

I'd guess an experimental Lisp interpreter embedded in Go is just too obvious :)

But providing Gophers with a slightly more polished alternative that still composes well with Go-code might help avoid the worst nightmares.

comment 7y ago · link · parent

It can using plugins from what I've seen. I'm not aiming for a regular Lisp though, g-fu is designed to be embedded in and complement Go first hand.

comment 7y ago · link · parent

You would have to wrap the call in a g-fu prim [0] for now. As for dynamically loading libraries, the plan is to implement g-fu libraries that call out as plugins. I have yet to dig into reflection to see how much effort an FFI would take.

[0] https://github.com/codr7/g-fu/blob/master/v1/src/gfu/abc.go

comment 7y ago · link · parent

I've been considering compiling the interpreter as a shortcut to native executables, but to Go rather than its AST since that allows reusing the existing runtime.

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

Cool.

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.

1
8283848586