Live data from Hacker News

A Functional Introduction To Computer Science

cs.uwaterloo.ca

11–20 of 40 posts

Re: A Functional Introduction To Computer Science

#11
post #6

Oh, they are using Racket. I really love that language. I think it's also great that they explain how to work with structures, instead of going the "everything is a list" aproach (the latter is, in my opinion, better suited for advanced students). Unfortunately, I haven't managed yet to integrate Racket into my daily work. The last time I tried to use it, the resulting (manually optimized) compiled code was as slow a…

I can't believe I have never heard of Racket before, it's 28 years old! Quite some libraries available too https://github.com/avelino/awesome-racket

Mentioned many times in the past 8 years on HN.

https://hn.algolia.com/?dateEnd=1688294284&dateRange=custom&...

Re: A Functional Introduction To Computer Science

#12
post #6

Oh, they are using Racket. I really love that language. I think it's also great that they explain how to work with structures, instead of going the "everything is a list" aproach (the latter is, in my opinion, better suited for advanced students). Unfortunately, I haven't managed yet to integrate Racket into my daily work. The last time I tried to use it, the resulting (manually optimized) compiled code was as slow a…

I'm really surprised to hear Racket code was slower than Python. Racket has had a JIT compiler for a very long time, and v8 has a much better JIT compiler, so I would expect its performance to be vastly better than Python.

Re: A Functional Introduction To Computer Science

#13
This is a very mathematically inspired introduction, as they say in the initial chapter.

What I would like to see is a logical introduction to computer science, or at least theoretical computer science.

Start with combinational logic [1], i.e. with Boolean circuits. They are both conceptually simple and relatively close to physical transistors, unlike any functional / mathematical approach. Then move on to sequential logic[2] which allows the introduction of memory/states, e.g. via flip-flops. From this, more complex circuits and even a primitive GOTO language would be introduced. What I would be interested in is how these circuits relate to the traditional models of computation, i.e. finite state machines, pushdown automatons and Turing machines. Not very cleanly, I suspect.

[1] https://en.wikipedia.org/wiki/Combinational_logic

[2] https://en.wikipedia.org/wiki/Sequential_logic

Re: A Functional Introduction To Computer Science

#15
post #13

This is a very mathematically inspired introduction, as they say in the initial chapter. What I would like to see is a logical introduction to computer science, or at least theoretical computer science. Start with combinational logic [1], i.e. with Boolean circuits. They are both conceptually simple and relatively close to physical transistors, unlike any functional / mathematical approach. Then move on to sequential…

It makes sense that it's a mathematical approach because Computer Science is ultimately a Mathematical discipline, the Church-Turing intuition aligns these machines to mathematics (and I would argue us too, but that's controversial).

Lots of elite CS courses start there, Cambridge did even when I was applying thirty years ago, Oxford does these days (back then it didn't acknowledge CS as a "real" subject, you were basically a mathematician and you'd just be studying this oddly practical sub-discipline of mathematics). Both teach an ML today. The place I studied began with an ML then too (today it begins with Java, which is I think inferior but they get $$$ so...)

My unconsidered guess is that your "begin with booleans" thing just gets to arithmetic via a long winding route, and either as it approaches arithmetic, or just before, it accidentally gets infected with Gödel incompleteness so you are no better off, with the same problems but maybe a greater appreciation of why they were unavoidable, except maybe you're very tired.

Re: A Functional Introduction To Computer Science

#16
post #6

Oh, they are using Racket. I really love that language. I think it's also great that they explain how to work with structures, instead of going the "everything is a list" aproach (the latter is, in my opinion, better suited for advanced students). Unfortunately, I haven't managed yet to integrate Racket into my daily work. The last time I tried to use it, the resulting (manually optimized) compiled code was as slow a…

I'm really surprised to hear Racket code was slower than Python. Racket has had a JIT compiler for a very long time, and v8 has a much better JIT compiler, so I would expect its performance to be vastly better than Python.

Hi Noel!

Yeah, Racket is faster than Python normally.

Re: A Functional Introduction To Computer Science

#17

Earlier quoted context omitted.

I'm really surprised to hear Racket code was slower than Python. Racket has had a JIT compiler for a very long time, and v8 has a much better JIT compiler, so I would expect its performance to be vastly better than Python.

Hi Noel! Yeah, Racket is faster than Python normally.

Hi Jens! :)

Re: A Functional Introduction To Computer Science

#18
post #13

This is a very mathematically inspired introduction, as they say in the initial chapter. What I would like to see is a logical introduction to computer science, or at least theoretical computer science. Start with combinational logic [1], i.e. with Boolean circuits. They are both conceptually simple and relatively close to physical transistors, unlike any functional / mathematical approach. Then move on to sequential…

Different roads that reach the same place, I think.

Finite state machines are a small step away from sequential logic and help with managing complexity. Pushdown automata are a small step from finite state machines. I think of Turing machines as an architecture for a computer consisting of a separate CPU and memory, which happens to correspond to the most common architecture used today, but not a particularly useful tool for managing complexity as they have no structure. Functions are useful for managing complexity, and function call / return requires some notion of a stack. Once you're there you can build up the rest of FP. Pure function correspond to combinatorial. Those with state correspond to sequential logic. etc.

Going in the reverse direction, compilation connects functional programming to hardware.

Re: A Functional Introduction To Computer Science

#20
post #13

This is a very mathematically inspired introduction, as they say in the initial chapter. What I would like to see is a logical introduction to computer science, or at least theoretical computer science. Start with combinational logic [1], i.e. with Boolean circuits. They are both conceptually simple and relatively close to physical transistors, unlike any functional / mathematical approach. Then move on to sequential…

It makes sense that it's a mathematical approach because Computer Science is ultimately a Mathematical discipline, the Church-Turing intuition aligns these machines to mathematics (and I would argue us too, but that's controversial). Lots of elite CS courses start there, Cambridge did even when I was applying thirty years ago, Oxford does these days (back then it didn't acknowledge CS as a "real" subject, you were ba…

> It makes sense that it's a mathematical approach because Computer Science is ultimately a Mathematical discipline

The fact that the abstraction "logical circuits" is much closer to actual computers than any "mathematical" or "functional" abstraction casts doubt on this claim.

Post reply on HN