HackerTrans
TopNewTrendsCommentsPastAskShowJobs

Blikkentrekker

no profile record

comments

Blikkentrekker
·13일 전·discuss
It's really not clear whether Rust does it or not and it just sidesteps the issues by calling them “structs” and “enums” but fields can be private of course.

Scheme Structs are rather interesting, when you define a struct the language by default also exports getter and setter functions with a predictable name though you can override the default name to give them any name, privacy is simply created by choosing to not export these getter and setter functions from the module.

Privacy on the module level rather than on the class level is a far better pattern to be honest. As in other classes defined in the same module can still have access to them.
Blikkentrekker
·13일 전·discuss
> After the dust has settled, it seems like the most valuable parts of OOP are private data, convenience (no need to repeat the class name in a method call), good fit for some domains, and interfaces.

Kay also considers CLOS and related things “true OO” and those do repeat class name in method call.
Blikkentrekker
·21일 전·discuss
There is a general culture that one sometimes sees which treats anything related to Japan as highly remarkable. Ancient Japanese swords can literally cut through diamond like butter by being folded over 1 000 times after all.
Blikkentrekker
·28일 전·discuss
The issue is that these functions in Lisps are variadic and can accept more arguments than one. `map`, and `zipwidth` in lisps are actually the same function.
Blikkentrekker
·29일 전·discuss
I feel languages should just have some kind of sugar or operator for this, in fact in Ocaml the |> operator exists where

   <exp> |> <exp2>
   <exp2>(<exp>)
Are just one and the same

For a variadic language you'd need something more involved though. But some kind of syntax can probably be invented in some language.
Blikkentrekker
·29일 전·discuss
That JSON prohibits trailing commata makes it an absolute pain to work with in practice.

I also like how in Haskell:

   something =
     { element
     , element1
     , element2
     , element3
     }
Is an actually idiomatic way to deal with the lack of trailing commata.
Blikkentrekker
·29일 전·discuss
> It's tough to answer because you want to hedge for both an AI enthused employer and an AI hesitant employer

That this doesn't have a clear and obvious answer one can expect shows how the issue is politics, not strategy.

When you apply as a mechanic, there is no such weird political debates about certain power tools where people have passionate opinions on which tool to use.
Blikkentrekker
·3개월 전·discuss
I think even the biggest hard drugs should be legal, again just because “people enjoy it”.

I'm fine with taxing it more in subsidized single-payer healthcare systems though but I also feel that should be done more consistently. I for instance also believe that say high heels should be taxed more because they're bad for one's health for similar reasons or unhealthy food but that's not “socially controversial” enough for that I get which is ultimately what it's always about. “health” is always just an excuse.
Blikkentrekker
·3개월 전·discuss
The same can be said for anything that's dangerous. In fact, one can make this argument simply for people who elect to study some field that isn't really very financially viable.
Blikkentrekker
·3개월 전·discuss
The thing with “harmful to society” is that in practice it's so arbitrarily decided what is “harmful” and in practice it comes down more to “arbitrary moralist reactions”.
Blikkentrekker
·3개월 전·discuss
Many dangerous things are legal simply because “people enjoy doing them” though.

People die during parachuting and climbing mount everest. What's the upside really beyond “People enjoy doing it and it's their own life.”?
Blikkentrekker
·4개월 전·discuss
> Every function takes one argument - a list.

That's one way to look at it, but the major difference is that one can also pass a a list as one argument, as in `(f x y z)` and `(f (list x y z)` are not the same. The thing with tuples is that a tuple of one datum is the very same as that datum itself and the same is true with the currying situation. `(f x) y` and `f x y` are truly one and the same in Haskell and Ocaml, just as `f(x, y)` and `let val a = (x,y) in f x` are one and the same in SML. This is not the case in Rust where `f(x,y)`, a function called with two arguments, and `f((x,y))`, a function called with one argument that is a tuple of two arguments are two different things.

There is also a difference in Scheme between returning a single value that is a list containing multiple values, and actually returning multiple values, In Rust however there is no difference between returning two values and returning a pair of two values. So Rust functions actually do properly take multiple arguments but always return a single one which may or may not be a tuple. In SML, Haskell and OCaml all functions technically take only one argument and return one value.
Blikkentrekker
·4개월 전·discuss
That person obviously did not want to be at risk for legal issues from Blizzard by publhsing it though. I personally wouldn't take that risk either.
Blikkentrekker
·4개월 전·discuss
I always felt Monads were an utterly disgusting hack that was otherwise quite practical though. It didn't feel like mathematical beauty at all to me but like a hack to fool to the optimizer to not sequence out of events.
Blikkentrekker
·4개월 전·discuss
> Simplicity: Every function takes exactly one input and produces exactly one output. No exceptions. If you didn’t care about the input or output, you used Unit, and we made special syntax for that.

Seems like a disaster to use s-expressions for a language like that. I love s-expressions but they only make sense for variadic languages. The entire point of them is to quickly delimit how many arguments are passed.

In say Haskell `f x y z` is the same thing as `(((f x) y) z)`. That is definitely not the case with s-expressions; braces don't delimit; they denote function application. It's like saying that `f(x,y,z)` being the same as `f(x)(y)(z)` which it really isn't. The point of s-expressions is that you often find yourself calling functions with many arguments that are themselves a result of a function application, at that point `foo(a)(g(a,b), h(x,y))` just becomes easier to parse as ((foo a) (g a b) (h x y))`.
Blikkentrekker
·4개월 전·discuss
In SML I believe. I never used SML but from how I understand it in ML all functions technically take one argument, which may be a tuple. In Haskell and Ocaml, all functions technically take one argument and just return a function that takes one argument again.

I never understood why the latter was so popular. Just for automatic implitic partial application which honestly should just have explicit syntax. In Scheme one simply uses the `(cut f x y)` operator which does a partial application and returns a function that consumes the remaining arguments which is far more explicit. But since Scheme is dynamically typed implicit partial application would be a disaster but it's not like in OCaml and Haskell the error messages at times can't be confusing.

I don't get simulating it with tuples either to be honest. Nothing wrong with just letting functions take multiple arguments and that's it. In Rust they oddly take multiple arguments as expect, but they can return tuples to simulate returning multiple arguments whereas in Scheme they just return multiple arguments. There's a difference between returning one argument which is a tuple of multiple arguments, and actually returning multiple arguments.

I think automatic implicit partial application, like almost anything “implicit” is bad. But in Haskell or Ocaml or even Rust it has to be a syntactic macro, it can't just be a normal function because no easy variadic functions which to be fair is incredibly difficult without dynamic typing and in practice just passing some kind of sequence is what you really want.
Blikkentrekker
·4개월 전·discuss
Well, it's otherwise “free” to read the article so I guess this is how one “pays” in the end.

I wonder how this works on mobile data though which is significantlym more expensive than home network data.
Blikkentrekker
·4개월 전·discuss
The issue is that it's a special case that acknowledges where there are cases where the indentation level it logically requires isn't what programmers find pleasant, there are many more, that just don't have that special case, so it forces indentation that's unpleasant and unintuitive.
Blikkentrekker
·4개월 전·discuss
That's just because most languages go by braces and have optional intendation that is just ignored by the compiler.

I'd reckon that in a language where stuff is done by indentation but optional braces exist that are just ignored so many errors would also have been caused by braces being misplaced by the programmer to queue other programmers who thought some scope happened as a consequence but the compiler disagreed due to the indentation, which by the way was caused by tabs and spaces being mixed in the code and it not properly showing up for another programmer with tab with set differently.
Blikkentrekker
·4개월 전·discuss
Functional hardly matters Haskell has plenty of indentation which is by the way interchangeable with `{ ... }`, one can use both at one's own pleasure and it's needed for many things.

Also, famously `do { x ; y ; z }` is just syntactic sugar for `x >> y >> z` in Haskell where `>>` is a normal pure operator.