4 ms·
A 5 year old can do bit of Python programming :). Start terminal, type Python and then type 2 + 3. Watch them getting kick out of typing huge numbers and Python
by sytelus 8y ago
A 5 year old can do bit of Python programming :). Start terminal, type Python and then type 2 + 3. Watch them getting kick out of typing huge numbers and Python spitting out the answers.
- jolux 8y agoSame with Haskell or ML family languages.
- bbeonx 8y agoAhhhh, but then they will ask how to print things and you'll have to explain monads :)
- jolux 8y agoI thought we were talking about a REPL instance. Have you already explained how to use a command line and what files are and how to run them? stdout?
- Godel_unicode 8y agoYou need none of that in a jupyter notebook.
- jolux 8y agoJupyter supports Haskell too though. As well as OCaml and Scheme...
- chasedehan 8y agoJust tell them they are like burritos. ;)
- coder543 8y agoZygohistomorphic prepromorphisms[0] are a common topic of discourse among five year olds, for sure... But more seriously, I strongly disagree about Haskell being anything like Python is for kids. The level of abstract reasoning that Haskell requires for more than just adding two numbers is not easy or intuitive for kids. Following step-by-step instructions is intuitive. Writing Python line-by-line is easy to understand by analogy to a list of instructions. Eventually they can start using functions when they're comfortable, but you're very unlikely to succeed in teaching a five year old about typeclasses, monads, functional purity, effect systems, or anything like that. The thing with Haskell is that you have have to know almost all of that to do anything useful from day one. Even something as simple as drawing lines on the screen.[1] Don't be ridiculous by suggesting Haskell is just the same to five year olds as Python. [0]: https://wiki.haskell.org/Zygohistomorphic_prepromorphisms https://wiki.haskell.org/Zygohistomorphic_prepromorphisms [1]: https://docs.python.org/3.7/library/turtle.html https://docs.python.org/3.7/library/turtle.html
- jolux 8y agoYes, I know the jokes about zygohistomorphic prepromorphisms. How about you try explaining Python decorators and object-oriented design to a five year old? > The thing with Haskell is that you have have to know almost all of that to do anything useful from day one. Okay, then how is adding two numbers together useful? If that's Python programming then the equivalent counts as Haskell programming. You are setting a double standard for what you expect a 5 year old to be doing. Even then, tell me which of these is simpler and more clear: def double(x): return x + x double x = x + x or, perhaps let f x = x + x The point I'm making is that with regards to syntactic complexity, Haskell and Python are similar, (in fact Haskell is actually _far_ simpler) and with regards to conceptual/semantic complexity, you have to be fair in comparing them together. You do not need to understand typeclasses, monads, or effect systems to do basic Haskell programming in GHCi.
- coder543 8y agoMy suggestion is that they won't write functions, not for quite awhile. Why would they ever need to understand decorators or object oriented design to start writing code!? They can write actual code though, not just addition in some REPL. In Haskell, you do need to understand a crazy number of things to do anything. That "actual code" I mentioned can involve drawing on the screen, which as I pointed out in painstaking detail, is not going to be explainable to a five year old with Haskell code. That kind of visual feedback is incredibly important to concrete learners, which everyone is at that age. Haskell and Python are not similar with regards to "conceptual/semantic complexity." At all. I have used Haskell in the past. I understand it. Someone who hasn't reached Piaget's "formal operational" stage is not going to understand it. Piaget's theory isn't perfect, but it is normally true that people start out at a very concrete level. As I said, don't be ridiculous. Here is some super complicated Python code that kids can learn a lot from: from turtle import * color('blue') forward(200) left(90) forward(200) left(90) forward(200) left(90) forward(200) left(90) done() Eventually, they'll move on to using for loops! Or even asking the user a question and drawing something based on that. You literally have to understand (at a basic level) monads and effect systems to start implementing a question-response system in Haskell. Please, show me what my above code looks like in Haskell, since it's so comparable in complexity. I don't think you have an appreciation for what goes into learning programming. You've probably been doing it for far too long at this point, without thinking back to the early days. Why are you so defensive about Haskell in the first place?
- jolux 8y agoI'm getting downvoted on this comment for basically saying that GHCi or utop will let you type in 2 + 3 and see 5 as a result too. The point I was trying to make was that if that counts as programming then it is not specific to Python. Ruby has it as well, to use a less scary example.
- earthicus 8y agoI don't disagree that 2+3=5 is inadequate, but to be fair you do hit a complexity wall pretty fast. If i've understood correctly, Haskell has two main datatypes for collections, lists and tuples. Using [1], if I was a 5 year old (or a 50 year old) to find the length of a list or tuple i would do this: λ length [1,2] 2 λ length [1,2,3] 3 No problems here. Now tuples: λ length (1,2) 1 λ length (1,2,3) No instance for (Foldable ((,,) t0 t1)) arising from a use of ‘length’ In the expression: length (1, 2, 3) No instance for (Num t0) arising from the literal ‘1’ The type variable ‘t0’ is ambiguous Note: there are several potential instances: instance RealFloat a => Num (Complex a) -- Defined in ‘Data.Complex’ instance HasResolution a => Num (Data.Fixed.Fixed a) -- Defined in ‘Data.Fixed’ instance forall (k :: BOX) (f :: k -> *) (a :: k). Num (f a) => Num (Alt f a) -- Defined in ‘Data.Monoid’ ...plus 7 others In the expression: 1 In the first argument of ‘length’, namely ‘(1, 2, 3)’ In the expression: length (1, 2, 3) No instance for (Num t1) arising from the literal ‘2’ The type variable ‘t1’ is ambiguous Note: there are several potential instances: instance RealFloat a => Num (Complex a) -- Defined in ‘Data.Complex’ instance HasResolution a => Num (Data.Fixed.Fixed A quick googling does not tell me how to find the length of a tuple. The closest thing to an answer is, 'you probably don't actually want to do that'. [1] https://www.tryhaskell.org/ https://www.tryhaskell.org/
- jolux 8y agoTuples have fixed size and are typically short and are not really collection types. They are a compound scalar that is meant to associate meaning with each position. Tuples can contain different types because of this, while collections are typically homogenous. Tuples do not also really have the concept of “empty” indices, in the way that fixed-size arrays do.
- taeric 8y agoHard to compete with the likes of logo and the modern scratch terminals. Sure, having a kid see addition is fun. But, they also think my old calculator is fun for stuff like that. Being able to build things in minecraft using a programming like environment? Bloody awesome.
- coder543 8y agoUnlike jolux's comment, I can agree with yours entirely. The tighter the feedback loop between code and graphical response, the more enticing it is to new learners. Scratch takes away the pain of trying to type picky syntax. It's a great starting point.
- taeric 8y agoMore than just the feedback loop between code and response. The feedback loop between what you have to do, and what you want to happen. Rather, I'd reword it. Just getting faster feedback from coding to some response is not enough. It has to be to the desired responses. (So, for example, it doesn't help to get faster feedback to syntax highlighting.)
- deleted 8y ago[deleted]