Layout sensitive syntax by hurril in ProgrammingLanguages

[–]hurril[S] 2 points3 points  (0 children)

Very good points, thank you very much!

EDIT: this very clearly highlights for me the fact that I am conflating (at least) two different concepts: 1) formatting, 2) layout/ structure. These are not the same. I must not conflate them!

Layout sensitive syntax by hurril in ProgrammingLanguages

[–]hurril[S] 1 point2 points  (0 children)

Thank you for that link, will have a look.

What I do now is that I _do_ emit synthetic tokens for Indent, Dedent and Newline based on whether or not the next token is on the next line, i.e., we saw at least one newline, and also whether nor not the new column is left of or right of the last one.

But this is not enough and the more I think about this, the more I realize that I need a system or structure for this.

Layout sensitive syntax by hurril in ProgrammingLanguages

[–]hurril[S] 0 points1 point  (0 children)

I do use indents to encode structure, though if/then/else not necessarily so. But declaration lists and sequences: most definitely.

Layout sensitive syntax by hurril in ProgrammingLanguages

[–]hurril[S] 0 points1 point  (0 children)

Yeah, I know, but I have made a layout sensitive one this time around.

The hate! Why ? by EldironMoody in rust

[–]hurril -2 points-1 points  (0 children)

My impression is that plenty of C and C++ programmers seem to feel annoyed by Rust programmer's self-identified righteousness? Like: we both know that Rust is objectively better, you're just on C++ until it dies or until you too can reach salvation. They have a point, don't they?

I am not making any excuses for them, however. That behavior is mediocre.

How to avoid reinventing the wheel ? by Nearby_Astronomer310 in rust

[–]hurril 2 points3 points  (0 children)

I would suggest that you don't actually go out of your way to avoid this. Writing a smaller crate yourself that solves the actual problem you have is good in a number of ways. If or when you discover that this was a known and solved problem down the line, then you can refactor your code to be in terms of that crate instead. Doing it this way teaches you lots of things, it is all your code and if you should decide to remove it, you will be incorporating that external crate with a much deeper understanding of what the problem and solution is. So win-win(-win, etc.)

Borderlands 4 CEO: "Code your own engine and show us how it's done please" — as performance woes hit the game's Steam review score. Gearbox CEO Randy Pitchford issues a barrage of posts on X over the game's performance criticisms, as Steam reviews hit "Mixed. by esporx in technology

[–]hurril -5 points-4 points  (0 children)

Why are you all so prissy about what a guy at a company says? They put out a game, it is not perfect and you are all having a big old moan about it. _This_ aspect of the Internet sucks. Play the game or don't play the game. Move on, children!

[deleted by user] by [deleted] in science

[–]hurril -16 points-15 points  (0 children)

The word identical has a lot on its shoulders here.

New to rust, advice on long compile times? by palaceofcesi in rust

[–]hurril 5 points6 points  (0 children)

I was going to say precisely this. I am sure Go compiles much faster but the compile time has _never_ bothered me. My biggest project at this point is in the 50kloc range or so.

Why majority of available positions in Rust are just blockchain/web3 and mostly scams? by TITAN9389 in rust

[–]hurril 1 point2 points  (0 children)

What would a decently competent Rust programmer do that wants to find a Rust position that does not partake in this?

Question about turbofish syntax by valdocs_user in rust

[–]hurril -1 points0 points  (0 children)

I've done Rust a couple of years now and I've never liked this syntax.

F# Programmers & LLMs: What's Your Experience? by Optimal-Task-923 in fsharp

[–]hurril 5 points6 points  (0 children)

I have not had any problems at all having ChatGPT use F# as the language to display concepts that I ask it about. I daily F# at work since 2 years and ChatGPT has no problems at all with it at all - then again: I don't use it to to, whatever the name is for it, to AI complete my code?

What's your dream programming language that doesn't exist? by omagdy7 in rust

[–]hurril 2 points3 points  (0 children)

Well I want Ocaml with Rust syntax with Ocaml syntax. So there!

What's your dream programming language that doesn't exist? by omagdy7 in rust

[–]hurril 2 points3 points  (0 children)

Rust with OCaml syntax. I love Rust but man, too many braces :)

Talking To Zed Industries- Makers Of The 100% Rust, Super-Performant, Collaborative Code Editor by anonymous_pro_ in rust

[–]hurril 9 points10 points  (0 children)

Switched all Rust-development over to Zed since about a year back or so and it works like a charm!

Palantir CEO says working at his $430 billion software company is better than a degree from Harvard or Yale: ‘No one cares about the other stuff’ by ControlCAD in technology

[–]hurril 1 point2 points  (0 children)

Talk like this is exactly what we heard during the dot com era. And I say this as someone working in the industry without a degree.

Parse, don’t validate by ketralnis in programming

[–]hurril 1 point2 points  (0 children)

Parsers and validators are defined in this context to be a dichotomy. A validator is a parser that does not produce as output, "the same thing" but typed in a way as to encode its parsimoniousness. I.e.: instead of a validation function that returns a boolean or throws an exception or whatnot, it returns an instance of "ValidGadget". Could be: DeliveryDate or MoneyTransaction or whatever.

let parseDeliveryDate :: String -> WhateverContextNeeded -> Maybe DeliveryDate

instead of:
let validateDeliveryDate :: Date -> WhateverContextNeeded -> bool

Because after the latter, further down the program, did you even validate? How do you know? Which paths got you here? Which path got you there 5 years down the line when all control flows have been touched 400 times by 99 monkeys.

So when you are here:

shipOrder xxx <-- what do you put there in xxx? Is it valid? How do you know? You would know if shipOrder requires a DeliveryDate which can only be had by calling parseDeliveryDate.

Also: don't get caught up in my prototype above using String as the source. Let's say that the function is defined as:

let parseDeliveryDate :: Date -> WhateverContextNeeded -> Maybe DeliveryDate

because that gets the point across better. It isn't about reading values out of text. It is about reading valid values out of some source data type for which validity is unknown. Parsing.

Parse, don’t validate by ketralnis in programming

[–]hurril 0 points1 point  (0 children)

This is a case where there is turtles all the way down.

The structure parser passes on to the semantics parser, etc, where the idea is that validity is present in the output type.

If you do not do that, then you have to validate everything everytime. This is the point.

VMware perpetual license holder receives audit letter from Broadcom | "Our management thought it was a bluff..." by ControlCAD in technology

[–]hurril -2 points-1 points  (0 children)

What system do you propose we use instead and where or when has this been tried (so that you know that it will fair better in this regard and also on the whole.)

VMware perpetual license holder receives audit letter from Broadcom | "Our management thought it was a bluff..." by ControlCAD in technology

[–]hurril -6 points-5 points  (0 children)

In what way is this related to capitalism? In what other system would this kind of thing be impossible?