Better HN
topnewbestaskshowjobs
Log inSign up

codr7

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

codr7@protonmail.com
Submissions

comment 6y ago · link · parent

They are examples of successful software consisting of proprietary code and commercial polish on top of an open source foundation. Which was my point, that even if it's not all open, it still results in higher quality software overall. So we still win, even if it's not the total domination RMS keeps insisting on.

comment 6y ago · link · parent

Mostly portable implementations of extensions for me; __thread, bool, inttypes.h, variadic macros, flexible array members etc. But declaring variables closer to the point of use is nice, as is struct initializers, compound literals and single line comments.

Compared to the rest, C99 contains a lot of useful improvements.

comment 6y ago · link · parent

It's certainly no Silver Bullet, and can be taken too far; but it was born as a reaction to the industry going way down the opposite drain. At least at that point, you know what kind of car you need. I still find it easier to refactor a simple solution into a more elaborate one than going the other way, easier to motivate as well as ripping out features is pretty much impossible in a corporate setting. Truth is always somewhere in between the extremes.

comment 6y ago · link · parent

I thought we pretty much agreed that's how it works for programming languages, and from my experience it applies to natural language as well.

My native language is Swedish. I've studied English since I was 8 (and I'm 42 now), German for 3 years in school and lived there for 4, two years of Italian and two years of Chinese. It seems the more languages I learn, the more interesting and worthwhile it gets to compare similarities/differences and the easier it is to learn new ones.

Learning a completely different language, such as Chinese coming from English, has similar benefits to learning Lisp coming from Java. It stretches the brain in exotic ways.

comment 6y ago · link · parent

I don't really buy into the political debate. The arguments for open source as applied to non-technical users don't really work as advertised from my experience. Sure, you could potentially find someone to maintain it if the version you depend on goes bottom up. But the contexts where that's the preferred solution are few and far between.

More important in my mind is that open source software is strictly higher quality from a technical perspective. Because it's not prostitution most of the time, it's passion and wider perspectives such as sharing knowledge. And a higher quality foundation means better software, because whatever commercial cruft someone adds on top it will still work better.

I recently reinstalled a laptop that was running Windows 10 with Kubuntu for a non-technical friend, which is not an excellent example but still applies since Canonical is semi-commercial. And it's a total win, because Windows is simply crap from the bottom up.

Android is another example, as is macOS.

comment 6y ago · link · parent

The most important kind of minimalism in my mind is YAGNI. Every single time I coded something I didn't need yet; I never did, at least not the solution I came up with. And once the complexity is in there, it's very difficult to scale back.

This applies to everything I've worked on, from personal projects up to 10KLOC to 3MLOC commercial systems. It's just never a good idea from my experience.

The code [0] I write these days tends to be pretty raw, but every single line fills a fundamental purpose.

[0] https://github.com/codr7/libceque

2317.

Show HN: libceque, a pool allocated C11 deque with value semantics(github.com ↗)

2 points · by codr7 · 6y ago · discuss

2318.

Show HN: Moment of Truth(github.com ↗)

2 points · by codr7 · 7y ago · discuss

comment 7y ago · link · parent

This is very true, contentment and acceptance are two more worthy goals to aim for. I find them easier to relate to and more fundamental.

My Yoga teacher used to say that it's useless to tell someone to relax, it's like telling them to not think of a pink elephant.

comment 7y ago · link · parent

Source control was simply painful before git. I remember desperately trying to get Subversion to compile and work way back in the days, because even though it was barely limping along it still looked like a way out of the hell that is proprietary, corporate source control.

I then went on to use subversion for a long time in different settings. Up until the day I finally tried git. This is not about centralized vs. distributed, it's simply superior software, period. Nothing else I've tried even comes close.

comment 7y ago · link · parent

Rabbit holes, you can spot them in most projects. Where someone got carried away with some sort of enlightenment. Oh, I know, everything is X. Well, no. Everything is, and always will be.

comment 7y ago · link · parent

Now I'm curious, what is it about macros you find repulsive?

And what's an 'implicit'?

I would trade real macros for almost any other language feature, as having them means being able to patch over whatever is missing.

The more powerful a language is, the less popular it will be. Couldn't be any other way, since only people with enough experience appreciate and feel comfortable dealing with them.

comment 7y ago · link · parent

And he's correct, as far as that goes.

It's the same story wherever you look, true Haskell believers make exactly the same claims. You just need to get used to it. And I'm sure I could, it worked for a little while in Haskell.

But as soon as I'm back using practical minded, general purpose tools; it comes back to me and I swear to never ever accept anything that doesn't make sense to me again.

This is not about being different, if you think that's the case you probably didn't take a very close look at forthy2. If it walks and quacks like a religious cult, that's what it is.

comment 7y ago · link · parent

For the record, this should now work as expected without copying.

comment 7y ago · link · parent

And now what?

I'm only half joking.

I'm glad you find pleasure in Joy, really am, programming should be more enjoyable. And having only read about it, I feel like they're related in spirit.

But this looks like madness to me. There's just too much stuff in there that has nothing to do with the algorithm. It feels like stacking monads in Haskell. Sure, it's cool and all, I mean that it works. And beautiful on one level. But still madness, as far as solving problems go.

comment 7y ago · link · parent

Thank you, I'll update the file accordingly.

And I agree: once you have a directive for checking versions, knowing which goes where is pretty critical information. Maybe someone should remind them?

comment 7y ago · link · parent

Ah yes, hardcore Forthers do seem to take pride in finding the absolute smallest number of fundamental building blocks.

There comes a point, though; where pretending everything is the same complicates rather than simplifies.

comment 7y ago · link · parent

I'm curious, what kind of messing with the return stack are you talking about?

The only thing forthy2 does that is slightly out of the ordinary is TCO.

comment 7y ago · link · parent

One of the main motivations in this case is embedding in C++, rather than trying to replace it. So far the language is implemented as a high level VM/interpreter, I'm planning to eventually emit C++ to get standalone executables and a 20-30% speed up.

So no, I didn't do anything :) It's all C++, all the way.

I suspect most standard Forths don't give a crap about the CPU, they like to implement everything themselves.

comment 7y ago · link · parent

They make great foundations, since their simplicity allows them to be conveniently adapted to whatever purpose.

I too find dogmatic Forth a struggle to reason about, which is why we're here I guess. A type system in combination with generic methods help a lot, since most mistakes are caught in dispatch and give reasonable error messages.

comment 7y ago · link · parent

Aight, seems like I need to adjust the required CMake version. It would help if I had any idea which version introduced add_link_options.

Anyways, the easiest way forward for you is most probably to upgrade your CMake.

comment 7y ago · link · parent

Nice.

I get the feeling that PostScript is close in spirit, they were also into pimping Forth using Lisp as inspiration. I think some of the HP-calculators also had similar languages, but never used them myself.

For me, generic methods (or words in Forth lingo) is the biggest deal. Followed by scopes and compound literals such as stacks and scopes.

comment 7y ago · link · parent

Stacks are reference types, the operation doesn't produce any new values. Half the time you want it there to push more items, or to display it in the REPL like in this case, but the other half you're going to drop it anyway.

I'm still undecided on the stack ops. There is one case in forthy2 where a reference is left on the stack, and that is splicing values into forms [0], where it's more likely you want to keep working with the same form. More likely is not a very good heuristic for designing API's though, so I might just go with the behavior you expected.

[0] https://github.com/codr7/forthy2#quoting

comment 7y ago · link · parent

I do hope you're right, convenient protocol access to email would change the game.

comment 7y ago · link · parent

I've dealt a lot with email along the way, trying to use it as an async transport layer for higher level messaging etc.

At one point I had wrappers around Python's IMAP/SMTP implementations that I excuted from Go, since at least Python had 20 years to make theirs work properly.

Any other implementation I tried failed somewhere along the way, especially as soon as you start moving messages around in folders or anything else beyond simply fetching messages.

SMTP is simpler from my experience, but then so is the work it performs.

I even played around with the idea of cooking my own to get out of this loop, but reading the specifications soon killed that idea. It would take a life time, probably be deprecated by the time, and still wouldn't work properly.

The new JSON-stuff honestly doesn't look much better from what I've seen. It seems to still be doing IMAP, only using JSON instead, which wasn't the problem. I'm not holding my breath about it becoming standard enough to depend on.

It's a mess, so much that I'm thinking it would probably be better to start over entirely.

comment 7y ago · link · parent

The implementation is definitely less Forthy as a consequence of embedding in C++ rather than aiming for rock bottom.

Bodies, or scopes, are first class though. You can take their references and/or quote them.

comment 7y ago · link · parent

I'm sorry, I'm not quite following. I don't get what you mean by dropping the stack in this context. Could you point to where in the README you're having trouble?

2338.

Show HN: forthy2 – a higher level Forth-remix in C++(github.com ↗)

65 points · by codr7 · 7y ago · 28 comments

comment 7y ago · link · parent

It's mostly a thick layer of lip stick though, as soon as something doesn't work you start paying for building on top an epic tower of crufty abstractions.

I once did some Java EE in Eclipse. They both look mostly the same to me. A mountain of crufty crap covered with as much lip stick as it took to make it sort of flop along.

I'm sorry if I'm stepping on toes here, this is just my experience. May I ask what you're using component frameworks for these days? I spent 13 years professionally writing reservation and accounting client/server apps in Delphi but never even came close.

1
777879
86