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

I'll try :)

The issue is that you can't interface methods from pointers to a contained struct, since it has no idea where it is or how it got there. Instead a pointer to the full struct needs to be threaded all the way down to where the overridden function is called.

I sort of understand why, but this is a major missing piece that makes it very frustrating to add anything but trivial default implementations to interfaces in Go from my experience.

comment 7y ago · link · parent

I'd go further and note that online software discussions in general seem increasingly dominated by complete beginners who couldn't care less about code except as a stepping stone to money and fame.

How this is all going to lead anywhere worth going is anyone's guess...

comment 7y ago · link · parent

Go makes composition less powerful than it could be by slicing structs, which means a lot of hoop jumping to get template methods (where blanks are filled in downstream).

I've been playing around with first class environments [0] lately in g-fu [1], which allow convenient and flexible composition of data and behavior using only what was already there.

I have a feeling Lua might be playing similar tricks with its tables, but I lack enough experience to judge.

[0] https://github.com/codr7/g-fu/blob/master/v1/lib/eos.gf

[1] https://github.com/codr7/g-fu

comment 7y ago · link · parent

I recently implemented a simple object system [0] using only closures and macros in a Lisp-dialect [1] I'm working on.

One thing that struck me is how little it bothers me that objects look like functions from the outside, and that any callable value could be used in their place.

It helps that the whole thing is quarantined in a separate library and that objects live in a separate namespace. And that it rests on top of a strongly typed environment.

Judging a type system outside of its context based on some arbitrary check list is pretty useless from my experience.

[0] https://github.com/codr7/g-fu/blob/master/v1/doc/functional_...

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

comment 7y ago · link · parent

g-fu author here,

I'll do my best to keep an eye on the discussion so feel free to ask questions/suggest improvements.

comment 7y ago · link · parent

It's the future, and always will be :)

comment 7y ago · link · parent

Trust me, I would rather not stick my head out in the shark pool at all.

But we're all in this together, and it's like watching a train crash in slow motion.

Doing my best for all is the only thing that makes sense to me.

2528.

Show HN: g-fu – a Lisp 2 Go(github.com ↗)

8 points · by codr7 · 7y ago · discuss

comment 7y ago · link · parent

Tell me about it.

I've lived here for three years, with a native speaking partner; but it's just not happening much.

Before that I spent three years in school studying German, all gone.

I don't like the language very much, I guess that could be part of the difficulty. It's just too damn complicated, the same way C++ is complicated.

comment 7y ago · link · parent

I know, I've unfortunately been slipping back into that nasty habit.

But I realize that it's a show my ego puts on for other egos; because that's just part of what egos do, mock any sign of being human.

Fortunately, the ashram is located in the middle of nowhere with plenty of wild nature to explore.

We were encouraged to not make any sounds at all, or gestures/miming; beyond what was absolutely critical.

comment 7y ago · link · parent

This used to be hilarious, but living it is about as much fun as predicted:

https://www.youtube.com/watch?v=9BnLbv6QYcA

comment 7y ago · link · parent

Southern Sweden, surprisingly enough :)

https://www.yogameditation.com/retreats/the-3-month-sadhana-...

comment 7y ago · link · parent

I did 3 months hard core full time Yoga in an ashram some years ago. As part of the program; I didn't speak, read or write for a month. Or cut nails or hair, but that's another story :) As an added bonus; the entire group followed the same program, which meant that I didn't have to listen to them either.

The main take home for me was that most of the things that I feel are really important to say in my daily life aren't. Once it was over, being expected to speak felt like a burden.

comment 7y ago · link · parent

I sort of got them for free :)

g-fu adds task isolation though, more along the lines of Erlang than Go.

Remixing Lisp is one of the most interesting things you can do in software as far as I'm concerned.

comment 7y ago · link · parent

Embedding Lisp as a scripting language is a nice way to balance performance vs. expressive power from my experience.

I recently started working on something similar [0] in Go.

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

2536.

Show HN: Meet the Loops(github.com ↗)

1 points · by codr7 · 7y ago · discuss

2537.

Show HN: Functional Objects(github.com ↗)

1 points · by codr7 · 7y ago · discuss

2538.

Show HN: Functional Objects(github.com ↗)

2 points · by codr7 · 7y ago · discuss

comment 7y ago · link · parent

I've been writing code on a daily basis for over 30 years; in umpteen different languages, some more typed than others. And I'm still not very fond of having types shoved down my throat, nor any other kind of restrictions.

We've been building computers and writing code for quite some time now, so long that some of us are beginning to notice the repetitions.

The fact that experience is so often dismissed begins to explain the mess we're in.

comment 7y ago · link · parent

You're ignoring the fact that many already went through that phase and ultimately decided that complexity is the only enemy worth fighting in software.

It always pays off to take a closer look at the things you can't think or say, to ask why.

2541.

Show HN: Functional Objects(github.com ↗)

3 points · by codr7 · 7y ago · discuss

comment 7y ago · link · parent

Real teaching is exploring, discovering, inspiring, reminding and pointing in the right direction. Not so much imposing a ready-made system of thought on others. It takes experience, and discipline to get to the point where this is possible without egos crashing the party one way or the other.

Someone said that finding good teachers is difficult, and that's true from my experience; but it 's a Sunday walk in the park compared to finding good students.

comment 7y ago · link · parent

Sounds a lot like the stories I've heard about other software legends, or any kind of legends really. Sadly there aren't many places left with enough margin for creativity, it needs space and comes without guarantees.

comment 7y ago · link · parent

It's not the same thing.

In Python you don't have the full power of the language at your disposal, you can't add primitives like if/class/etc; in Lisp, the sky is the limit.

The lambdas are crippled; as are the threads, using processes is a completely different game.

I would consider spending some of that energy on learning Lisp.

comment 7y ago · link · parent

Sure thing.

Until the last paragraph.

There comes a point in every amateur programmer's evolution when learning which way is up and picking more powerful tools is the right thing to do.

comment 7y ago · link · parent

So long Joe, and thanks for coming here and doing your thing.

Erlang changed my way of thinking in several ways, a quick glance at some of my own creations [0] makes that pretty obvious.

[0] https://github.com/codr7/g-fu#tasks

comment 7y ago · link · parent

There are plenty of compelling reasons to use other languages. Macros, types, threads, interfaces, lambdas, tail calls etc.

But what matters in this world is short term profit. Python is easy to get started with, has a ton of frameworks than can be duct taped into semi-working software by mostly anyone and is taught in many schools.

comment 7y ago · link · parent

I was confronted with recursion early on, but didn't really see the point outside of tree/graph traversals. It just didn't seem worth the effort given lousy performance and constant risk of stack overflow.

Then I started writing Lisp, and the &rest is history.

The cool thing about optimized tail recursion is that any loop you can dream of [0] is just a macro away. It also helps with keeping the core of the language clean, as fewer primitives are needed.

https://github.com/codr7/g-fu#macros

comment 7y ago · link · parent

It's at the bottom of the readme, LGPL3; but I forgot the license file.

Thanks for bringing it to my attention.

1
8283848586