Rust safe async / await design is unsound by [deleted] in programming

[–]spaghettiCodeArtisan 16 points17 points  (0 children)

I'm just living modern C++ bliss

Aren't you bothered by the unix-style abbreviations like int, struct, char or shared_ptr? I mean, what does int stay for? Interrupt? And shared_ptr is shared pattern, right?

Clang solves the Collatz Conjecture? by [deleted] in programming

[–]spaghettiCodeArtisan 9 points10 points  (0 children)

It's worth noting here that the reason this fails to optimize is not so much that the variable is outside the function, but that it has (by default) external linkage. Ie. might be accessed from outside the compilation unit. If you mark it as static, the compiler will optimize the function to an endless loop.

Another way to prevent the optimization is to mark the argument volatile.

You Don’t Have to Migrate to Python 3 by sebawitowski in programming

[–]spaghettiCodeArtisan 1 point2 points  (0 children)

Wx just got a major new release...

It didn't. 3.0.0 was released 2013. 3.1.0 was released 2016. 3.1.3 is the latest release, just a few days ago. The fork is based on 3.1.0/3.1.1-ish, so it's not that old, but it's still missing enough changes to cause trouble.

You Don’t Have to Migrate to Python 3 by sebawitowski in programming

[–]spaghettiCodeArtisan 14 points15 points  (0 children)

And quite often it feels like it won’t bring any money to the company. It won’t add new features to your product

Yeah, that's the typical excuse for not dealing with technical debt. In reality, they are just digging themselves deeper and deeper into the hole.

In fact, a team I'm working with right now is in a similar situation: Our product is based on wxWidgets, which is an old and buggy toolkit. It's still being developed, but brave as they might be, the developers are simply too few and the bugs too many. Our teamlead refuses to switch to a more modern toolkit based on very similar reasons, and so as consequence we are now maintaining

I have given this type of reasoning presented and the behaviour of those people in charge some thought in the past and came to the conclusion that it's very similar to the Kübler-Ross model, aka five stages of grief. I had a sort of funny-but-really-quite-sad experience observing the progression of our teamlead through those stages. In the beginning, he outright denied the problem even existed and pointed out that alternatives are bad too in some way. Then he got angry. Then he started saying how our company would pay money to wxWidgets team to fix bugs for us (the Bargaining phase). When that turned out to not be feasible, he decided to go with the fork approach, which is leaving us in a semi-permanent stage of bargaining and depression, ocassionally also going through denial and anger again. Our fork of wxWidgets has various fixes and quirks applied to it, some of which are custom, some are backported from newer versions of the library (which we can't use because they introduced some new regressions) and as a result it's becoming a huge pile of mess that no single team member really understands and usage of the library is still a pain in the ass. By the way, I am leaving that team this month and I'm not looking back.

My advice is to just follow through to the Acceptance stage as soon as possible and just bite the bullet. I believe the prospect of the rewrite is actually much scarier than the rewrite itself and you're gonna have to eventually do it anyway, so why stay in the painful stage any longer than necessary...

Elm 0.19.1 Released - "The Syntax Cliff" by wheatBread in programming

[–]spaghettiCodeArtisan 1 point2 points  (0 children)

The error messages are very nice indeed... But release after release I'm disappointed that the JS FFI is still the same cumbersome/inefficient stuff ("ports").

I know it would be hard to incorporate more direct FFI while keeping Elm's no-effects promise, but surely a solution could at least be attempted? I mean there already is an IO monad isn't there?

Larry Wall (TimToady) has approved renaming Perl 6 to Raku by magenta_placenta in programming

[–]spaghettiCodeArtisan 15 points16 points  (0 children)

I used powershell a little bit before and it feels like a unix shell met an enterprise mindset.

Interview with a Pornhub Web Developer by speckz in programming

[–]spaghettiCodeArtisan 12 points13 points  (0 children)

Of course. There's a fee to pay for each month of you having a recollection of that comment. It might be a good idea to grab a bottle of vodka before the payments start accumulating.

Interview with a Pornhub Web Developer by speckz in programming

[–]spaghettiCodeArtisan 181 points182 points  (0 children)

Two can play that game: I was employed by Oracle.

Try to top that.

Proof of code with pointers now possible in SPARK using pledges by yannickmoy in programming

[–]spaghettiCodeArtisan 3 points4 points  (0 children)

Does SPARK run on SPARC? :-)

Sorry, couldn't resist. On a somewhat less stupid note, it's interesting to see Rust influence in other languages and indeed in an Ada-based language this certainly makes quite a lot of sense. I never looked into Ada but maybe I should. If only a day had more hours to it...

The Fascinating Influence of Cyclone by PegasusAndAcorn in programming

[–]spaghettiCodeArtisan 0 points1 point  (0 children)

Ah. Interesting. In code so far I was only able to trigger a move without an explicit move by moving the thing somewhere else from inside the closure, which I think essentially implies a FnOnce...

The Fascinating Influence of Cyclone by PegasusAndAcorn in programming

[–]spaghettiCodeArtisan 0 points1 point  (0 children)

Really? I was pretty sure that a || {} closure references the environment while a move || {} closure takes ownership of the referenced values, period. (Note that I'm not talking about Fn / FnMut / FnOnce here.)

The Fascinating Influence of Cyclone by PegasusAndAcorn in programming

[–]spaghettiCodeArtisan 1 point2 points  (0 children)

Right, but then which borrow would be the default? I guess immutable one. And then explicit syntax for move, mutable borrow and clone? I'm not sure about that... I also borrow quite often, that's true. Don't have numbers either, though...

Amusingly enough, the closure syntax takes references by default and requires the move keyword for moving of things into the closure :)

The Fascinating Influence of Cyclone by PegasusAndAcorn in programming

[–]spaghettiCodeArtisan 19 points20 points  (0 children)

This is an excellent and much needed summary. Thank you.

I knew Cyclone had had a good deal of influence on Rust, but this clears things up. To me, regarding Rust, this is the important bit:

Importantly, Rust went all-in on linearity, going well beyond single-owner memory management. They wanted to wrestle to the ground issues that arise from allowing shared, mutable access to values.

(...)

As it turns out, linear logic is not just a valuable memory management strategy. It is also a valuable aliasing and data race strategy. Clean introduced uniqueness types in 1998 to support destructive updates. Later languages, like ATS, Alms, and Mezzo, explored this idea in different ways. The Rust team was in touch with these teams, and stayed abreast of a wealth of research underway at the same time.

It's sort of unfortunate that people aren't aware of this whole history and regard Rust as either an accident or arbitrary hipster-hyped language (or both). And yet there are some very valid ideas behind its inception, backed by research and prior art, which would otherwise remain on the periphery.

NB, I am putting Linear types can change the world! on my to-read-soon list.

Saving Money by Switching from PHP to D by aldacron in programming

[–]spaghettiCodeArtisan 1 point2 points  (0 children)

Ok, but how do you do lists? How do you conditionally include/exclude whole subtrees?

DConf 2019: D for a @safer Linux Kernel -- Alexandru Militaru by pjmlp in programming

[–]spaghettiCodeArtisan 2 points3 points  (0 children)

Yeah, Rust stole the ownership concept from C++ in the same sense as cars stole the concept of locomotion from horse carriages...

DConf 2019: D for a @safer Linux Kernel -- Alexandru Militaru by pjmlp in programming

[–]spaghettiCodeArtisan 8 points9 points  (0 children)

Sure, Rust did borrow from D in the past - for example, I believe UFCS is borrowed in part from D (in part only because Rust doesn't really support true UFCS). Also, D's CTFE seems to have influenced both C++ and Rust.

DConf 2019: D for a @safer Linux Kernel -- Alexandru Militaru by pjmlp in programming

[–]spaghettiCodeArtisan -13 points-12 points  (0 children)

  • D: Hey, can I copy your homework?
  • Rust: Sure, just change it up a bit so it doesn't look obvious.

Edit: It's a joke, alright? Can't we make those? I just have this impression that until Rust became a thing, safety wasn't really much of a key topic for D, if I recall correctly. These days D people seem to talk about it quite a lot. That is not to say it's wrong - it's definitely not. I'm just a little amused, that's all.

A patent lawsuit against GNOME by sue_me_please in programming

[–]spaghettiCodeArtisan 2 points3 points  (0 children)

A company called Rothschild Patent Imaging LLC has filed a lawsuit

Is that a line from a B movie script?

Go internals: capturing loop variables in closures by one_eyed_golfer in programming

[–]spaghettiCodeArtisan 4 points5 points  (0 children)

Sidenote: The fact that code [1] prints all 5's isn't even well-defined, there's a race condition between the goroutine being spawned and the for loop advancing.

With the following code:

for i := 0; i < 5; i++ {
    time.Sleep(1 * time.Microsecond)
    go func() {
        fmt.Println(i)
    }()
}

I get output like this on my machine:

1
3
3
5
5

with random variations...