expr

joined 1 year ago
[–] [email protected] 3 points 2 weeks ago (1 children)

It's how recruiters find me, so unfortunately I can't. I almost never open it, though.

[–] [email protected] 5 points 2 weeks ago

It's speed, but it's also flow and a continuous stream of thought. If all your editing is being done with muscle memory and minimal thought, you can continue thinking about the problem at hand rather than interrupting your thoughts process to fumble through some context menu to make a change.

[–] [email protected] 1 points 2 weeks ago

I made this mistake for ages because Haskell is so popular and it's functional and pure, but it's not actually a requirement for functional languages to be pure. OCaml isn't.

I didn't say that FP languages have to necessarily be pure, just that FP languages tackle the problem of mutation by arranging programs such that most things are typically pure and side effects typically happen at the periphery (logging is probably the one exception, though). This is true even in FP languages that allow arbitrary side effects in functions, it's just not enforced by a compiler.

I agree Rust code has a different feel to OCaml code but that's because it makes some things easier (e.g. mutation, vectors). You still could write Rust as if it was OCaml (except for the lack of currying), it's just that nobody does that because it sucks.

That's the entire point, though. It's all about what the language emphasizes and makes easy to do. If it's unnatural to write a functional program in Rust and no one does it, then it's not really reasonable to call it a functional language. Writing functional programs is not idiomatic Rust, and that's okay.

[–] [email protected] 1 points 2 weeks ago* (last edited 2 weeks ago) (2 children)

Fundamentally it's a language oriented around blocks of statements rather than composition of expressions. Additionally, it takes a different approach to the mutation problem than FP languages: where FP seeks to make most things pure and push mutation and side effects to the edges of the program, Rust uses its type system to make such mutation and side effects more sane. It's an entirely different philosophy when it comes to programming. I don't think either approach is necessarily better, mind you, just a different set of tradeoffs.

I'm a professional Haskell developer and am very much immersed in FP. When I read Rust code, I have to completely shift my thinking to something much more imperative. Whereas if I read, say, Ocaml, the difference is mostly syntactic. This isn't a slight, mind you. I quite like Rust. But it's a very different paradigm.

[–] [email protected] 1 points 2 weeks ago (4 children)

It's not a functional language at all, even if it borrows ideas from FP languages. It's an imperative language through and through.

[–] [email protected] 1 points 3 weeks ago (1 children)

This is completely different from electron. Nix dependencies will be shared if they share the same hash. Electron just blindly copies everything over every time.

[–] [email protected] 1 points 1 month ago (1 children)

A language is not functional just because it supports higher order functions. Technically C even supports them (even though the ergonomics and safety of them are terrible). Would you call C a functional programming language? Obviously not. Rust is also not a functional language, even though it comes closer than most OO/imperative languages.

Kotlin and plenty of other OO languages have borrowed some ideas from functional languages in recent years because those ideas are useful. That doesn't make them functional languages. If Kotlin were a functional language, then it wouldn't need libraries like arrow to try to make doing FP in Kotlin even (kind of) possible.

Hallmarks of FP (beyond higher-order functions), in no particular order:

  • Organization around functions as the fundamental unit of code
  • Code primarily defined in terms of expressions and data transformations rather than statements manipulating object state (so languages that have big blocks of imperative statements like Kotlin don't count)
  • A general orientation around pure functions, even if they vary on the degree to which they enforce purity
  • Explicit parameter passing being the standard and preferred way of providing data to functions, rather than methods operating on implicit state
  • First class support for function composition (method chaining doesn't count)
  • Pattern matching and destructuring as a first-class and ubiquitous concept (what Kotlin does have is a joke comparatively and no one would actually call it that)
  • For statically-typed functional languages, first class support for algebraic data types (Kotlin has sealed classes which can kind of be used to try to emulate it, but it's pretty awkward in comparison and requires you to write very OO-ish code to use)

There are some minor exceptions, such as Clojure lacking pattern matching, but on the whole functional languages generally fit these descriptions.

[–] [email protected] 1 points 1 month ago (3 children)

That list also counts Java and C# as "functional languages". I wouldn't take it too seriously. Ocaml, Scala, F#, etc. are impure functional languages. Kotlin absolutely is not. Having a couple of features you might find in functional languages does not make a language functional. Kotlin is still very much an OOP-based language. It's basically a somewhat nicer Java.

[–] [email protected] 1 points 1 month ago (5 children)

Minor nit: Kotlin is decidedly not a functional language.

Design patterns in OOP exist purely to solve the problems created by OOP itself. If you have a language with proper ADTs and higher order functions, the need for traditional design patterns disappear since the problems they solve are first-class features baked into the language.

The first-class replacement for the Strategy pattern (and many other patterns such as the Visitor pattern) is sum types (called enums in Rust).

[–] [email protected] 3 points 1 month ago (1 children)

Any examples of the claim that he's embraced FP more?

Last I saw, he was making wild, baseless assertions about FP concepts like monoids and monads on Twitter.

[–] [email protected] 1 points 1 month ago

Yeah wtf, 100ms is great.

300ms is the average reaction time in humans. Less than 100ms reaction time would be insane and I'm pretty sure it's something no one has actually achieved.

[–] [email protected] 11 points 1 month ago* (last edited 1 month ago) (3 children)

Okay, but it is false to claim that she is a enthusiastic supporter without any evidence of said support.

view more: next ›