HN user

jcora

148 karma

flowing.systems

Posts4
Comments88
View on HN

Sounds snarky but completely correct. Parent should look for a more diverse set of examples for vector spaces. In fact sounds like a good linear algebra course would be a priority over group theory

No lol it's not possible to learn any math subject in depth in an afternoon, unless you mean "get a surface overview that you'll forget most things about in a couple of weeks". Proper foundations for non-Euclidean geometry are at least a one-semestre undergrad class level of work, which will take you at least several weeks if you do _only that_

Yeah absolutely not. You can certainly drink and work, just as it's possible to drive drunk without killing someone.

These isolated cases without incident don't really matter in the context of society-wide taboo, however.

Coffee and cocaine are worlds apart. Most people don't have jobs that would work with a coke addiction. Freud was exceptional and I think he did most of his influential work not under the influence anyway.

I don't see how you could actually come up with new stuff in PLT without a very heavy math background, specifically in logic. I mean it's not impossible just extremely unlikely.

I don't know man. I feel like there are places I know more than Rob Pike almost certainly. Like, I don't know, most of functional programming. I seriously doubt he knows what indexed monads are better than me.

So, at the point they were creating Go, I think it's perfectly reasonable they had even less exposure to fp, and didn't actually know about these better solutions.

One big problem with the plan, which a lot of people don't realize, is that your typical university math degree isn't that much more challenging than doing well in high school math.

I think this is very US-specific. Here in Europe there's definitely a huge difference. You enroll in a pure math-only 5 year degree, and are talking about topology in your third semester already. That might be a specific thing only my analysis prof does, but quite a lot of time is devoted to neatly delineating different levels of structure you're equipping a space with, proving things with as less structure as possible or at least discussing it. You are expected to juggle tricks on a totally different level, which takes a lot more qualitatively different practice than in HS.

When I talk to people who take math classes in the US it's usually not on that level of engagement until the graduate courses. Maybe it depends on their university, in smaller European countries you often have just like one main math program that is then high-intensity.

I use almost no lambdas in my functional code. I don't understand why they're thought to be paragons of FP in non-pure language communities. Maybe because there are no operator sections, currying, and the syntax is more verbose so it's not as easy to define helpers.

Kim Peek 7 years ago

This could be a case where cognitive functions were highly uncorrelated. For example he could've had enormous working memory but extremely low spacial intelligence. In most people these are highly correlated and so IQ can be an informative number but in his case, it might carry less information.

It is always a good idea to read a philosopher through Deleuze's words. If there's one philosopher whose main sticht was distorting others in productive ways, it's Deleuze. It is a pretty up-front distortion ("taking them from behind and giving them a bastard child"), but usually providing an incredibly useful new perspective

Or go all in and actually expose yourself to an entirely different programming paradigm, there is so much more to "FP" that you can only find in Haskell and beyond.

Now I present it as a geek thing that is of no relevance to the general public.

As you should. Linux shit DOESN'T work, for a defintion of work 99% of us use. It ate away so much of my time, with the various distros, until I realized how much simpler it is on Windows.

This isn't about modelling rather a programming technique, but check out Idris for its dependent typing. It lets you encode state machines in types, which means your programs literally will not typecheck if you try for example to withdraw money from an unauthorized ATM, or candy from an empty store. You can make verified network protocols and drivers like this.

because you can also say

I don't think you can actually:D

I mean for each category of programmer there is a pretty clear line separating common knowledge from things you can't expect people to know. And for pretty much every category of programmer, if statements and category theory are the opposite ends of that line.

I mean I feel like you agree with this based on your first paragraph, his complaint isn't odd because it's saying you can't expect people to know category theory, it's because he thinks that category theory is necessary here.

but I don't understand that is connected to model software on paper

I was talking more generally about techniques that allow for sneaking in mathematical thinking in various stages of development, not just modelling. Largely because of the very precise types which make a large part of your program verifiable (and force you to think about a lot of things you wouldn't have if you were using, say, JavaScript).

I was recently making a script engine for a game. It was really neat to realize that the "runScript" method was literally just a mapping between two monads. No special state inbetween, no complex logic, no file lookup or anything like that. These types of insight accumulate, and there's really a tonne of stuff to learn (this potential for learning the language itself feels much greater in functional programming for me).

Isn't there any easier way to describe I/O than with category theory?

This isn't category theory! Do you really think every working Haskell programmer is some mathematician? No. Look at this random image I googled, you think Haskell programmers understand this? https://i.stack.imgur.com/4IzGk.png Most mathematicians don't!

The notion of a monad in functional programming might be inspired by category theory, but you're really better of not taking that connection too seriously. Functors, applicatives, and monads are all very simple notions that should be understood as programming constructs, not arcane math. If you want an area of math to research to most benefit your functional programming, that is undoubtedly mathematical logic and/or intro-level type theory, and not category theory. (This should take you in the direction of dependent types.)

Really, types are the key. The notion of a monad is best understood not through vague real-world analogies with sandwiches, but through the type and implementation of its >>= method. The reason for that is that the point of monads is in composition. And basic linear algebra is enough to understand the importance of composition, not category theory. Just look at the Maybe monad to immediately understand it: Nothing >>= f = Nothing, Just x >>= f = f x, where f : a -> Maybe b. Isn't this a really clear, intuitive way of composing operations which might fail?

Same goes for IO. The only thing you're doing is composing some values. When you compose an IO Int with some function of the type Int -> IO (), you get back a value of type IO () (which your runtime executes if you bind it to main). All of this is right in the type, and it's just as intuitive a way of composing IO values as Maybe ones, IMO.

You get the added benefit of execution becoming not a side-effect, but a first-class member. Evaluation of IO programs is not their execution, you could evaluate putStrLn "asdf" a million times without it being executed. You can literally store those programs (values) somewhere and execute them later.

Math isn't formulas. The part of math that is most useful for programming are algebraic structures. Many "patterns", conventions, frameworks, etc., are just bastardizations of mathematical patterns. What really matters is the composition of concepts, and what better way to think about that than mathematically?

So if you want your programming to reap the benefits of (others', mostly) mathematical reasoning--use a functional language that is all about expressing the ways in which things compose!

IO is modelled pretty well through monads. As are many other things, like nondeterministic processes, exceptions, state, etc.