Live data from Hacker News

Computer Science from the Bottom Up (2013)

bottomupcs.com

141–150 of 161 posts

Re: Computer Science from the Bottom Up (2013)

#141

Earlier quoted context omitted.

All software is related in some degree. You will find that people who come from a background of compilers will do well in developing certian portions of games. In a sense most games are a compiler. You feed it in source (images, dialog, models, textures, etc) and it spits out an interactivly compiled narrative. Websites are also compilers. They just operate on a higher level of abstraction then the simple toy compile…

Even most people I know who have written compilers haven't written assemblers; neither have most people I know who have written (real, not toy) programs in assembly. The argument isn't that it would be useless, but rather that it's an extremely inefficient use of one's time and money if the goal is higher level development - or even, I'd argue, if one was aiming for a proficiency writing programs in assembly. Again,…

> extremely inefficient use of one's time and money if the goal is higher level development

Have you ever written an assembler?

Have you ever written a compiler?

An Assembler is far simpler then a compiler and after building the Assembler a compiler is an extremely strait forward next step as you've already finished the first quarter of what you need to do in a compiler. You've tokenized (broken the problem into small bits) and you've generated some opcodes. That's the perfect starting place for any systems programming background and a systems programming background is the perfect place to start out at higher level languages.

Re: Computer Science from the Bottom Up (2013)

#142

Earlier quoted context omitted.

To the outside world of non-CS people the concept of a processor is magic. It is in a sense still magical to me but I can see that a processor is just a complex state machine that takes in numbers and spits out numbers. Saying that without really experiancing it means nothing and I cannot put into words the value of understanding this. It makes so many previously unaprochable tasks much less daunting. Copying in hex…

> It's not magic it's just a simple map operation taking the text from the assembly and 1:1 mapping it (in most cases) to opcodes. Maybe in the Z80, but in modern x86 the instructions are broken down into micro ops and also pipelined (multiple pipelines, even). > Knowing the opcodes by heart is nice for debugging and decompiling/reverse engineering code. It's fun to do and a really important skill, in my book, for an…

You've taken assembly, transformed it into opcodes in paper, and then manually typed that into a file.

The instructor should ask "Is there a way that you can do this that would allow you to avoid doing this?"

You've now been - Told there's a better way - Want to stop doing this as it's error prone and boring - Know every step of binary construction by heart

That's the perfect starting ground for exploring cs in my book.

Re: Computer Science from the Bottom Up (2013)

#143
post #126

Earlier quoted context omitted.

>Know your data access, and the data structure design has meaningful discourse. Don't know your access patterns? You are unable to pick the best one. Period. Pretty much: if you don't know the access patterns, draw up a naive implementation so you can figure them out. This is actually connected to one of the disadvantages of Lisp: because Lisp makes it so easy to draw up a naive datastructure based on LLs, it can tak…

I am in complete agreement that lisp makes it possible to write slower programs. I just challenge that it is an inherently slower language. I view it as reducing the coefficient of writing a program. This means more will be made. So more slower ones will get made. However, nothing prevents you from writing a fast program in that language. Other than the slower successes.

With a compiler smart enough to aggressively cull any uneeded dynamism, it might be possible. But it would still be hard.

Re: Computer Science from the Bottom Up (2013)

#144

Earlier quoted context omitted.

> Theory is useless without implementation and implementation is nothing without an understanding of theory. I feel that you greatly misunderstand why theory is important. It is not just something to be memorized to aid in implementation. It is useful and interesting in its own rite. CS Theory is Mathematics and like mathematics can be pursued simply with the goal of better understanding. An understanding of Turing M…

> feel that you greatly misunderstand why theory is important. It is not just something to be memorized to aid in implementation. It is useful and interesting in its own rite. CS Theory is Mathematics and like mathematics can be pursued simply with the goal of better understanding. I don't think you understand what I mean. I don't mean the theory isn't important. Nor do I feel that the only thing important is the the…

> If you're learning theory before running into WHY you need that theory then you by definition don't care

My point is that there does not need to be a need for the theory. Learning for the sake of knowledge is enough. If you don't care about that reason though, learning much of theory will be hard unless you have a more concrete reason (a need for the theory in practice).

> Do you think I could write a radix sort off the top of my head with no prep time? What about something easier like a merge sort? No. I don't care because my job isn't writing sorts.

I think pretty much all programmers should be able to write a merge sort off the top of their heads. At its core mergesort is really just `merge(mergesort(leftside),mergesort(rightside))` which should not be hard to remember and writing the splitting of the list and merge is something any decent programmer should be able to do.

I will give a pass on radix sort though, it is a little more complicated and not at widely known. (I would also excuse not knowing how to implement heapsort).

> > The same could be said for teaching implementation. Thoughtless memorization is rarely useful in any field. You can instead have them discover the theory like they would discover an understanding of implementation you advise. > The entier point of my post is to say we shouldn't do that. We should give them a task that they will want to acomplish

I am not sure I understand your response. Would you not have people naturally discover theory with strategically minded hints to help make sure they don't get stuck for a long time?

> The theory should come as you get stuck, not before. The act of getting stuck and then pulled out of the hole is what teaches you when something is meant to come in handy. > One such example is when your car battery dies. You probably don't have one of those self-jumping battery packs in your car but they come in handy. You only ever see why after your battery goes flat and you cant find anyone to give you a jump.

Oftentimes you need to know the applicable theory before you get into a problem that necessitates it because you would never know that the theory even existed unless you had studied something related. For most practical people, a decent taste of some of the big theoretical ideas should be learned simply to facilitate later on-demand looking up of theory.

For example, big O is a powerful concept, but you may not have ever heard of it unless you looked into theory of algorithms. Despite that you may start writing some brute force (exponential time complexity) algorithm and not realize that is a problem while working on AI pathfinding for a game. Despite there being many polynomial time complexity algorithms out there.

More seriously though, knowing a number of NP-complete problems may help you realize that a problem you are working on is NP-hard and thus you should stop looking for a polynomial algorithm for it (unless you think you can break NP =? P).

Following your analogy, what if you never knew that even jumper cables existed and instead got your car towed to a mechanic every time your battery died. You may learn about jumper cables after doing that once, but it would have been much better if you knew they existed beforehand.

Re: Computer Science from the Bottom Up (2013)

#145
post #111

Earlier quoted context omitted.

> An algorithm that takes infinite time Can you give an example of such an algorithm? My understanding of an algorithm is that it must terminate in a finite amount of time, but maybe you have a different definition of an algorithm

> My understanding of an algorithm is that it must terminate in a finite amount of time Any practical algorithm yes. Any theoretical algorithm no. This is where the will it hault questions come from. Check out Ackerman's function as a good example that we aren't sure if it will terminate. It is still extremely interesting from an algorithms analysis perspective but not from a CS (as I use it) perspective. Also I'm no…

The algorithm that computes Ackerman's function recursively (https://en.m.wikipedia.org/wiki/Ackermann_function) always terminates in finite time

Re: Computer Science from the Bottom Up (2013)

#146
post #126

Earlier quoted context omitted.

I am in complete agreement that lisp makes it possible to write slower programs. I just challenge that it is an inherently slower language. I view it as reducing the coefficient of writing a program. This means more will be made. So more slower ones will get made. However, nothing prevents you from writing a fast program in that language. Other than the slower successes.

With a compiler smart enough to aggressively cull any uneeded dynamism, it might be possible. But it would still be hard.

A pragmatic view, perhaps, is that as a tool, a given Lisp environment doesn't constraint how fast a solution we can devise to a problem in some manner. That really fast solution might not simply be a Lisp program fed to the Lisp compiler.

Suppose you're required to solve a problem with very high performance, and it has to be expressed in some high level language. No high level language achieves it using any straightforward code without dropping to assembly language. Not C, nothing.

In that situation, I'd arm myself with Lisp, because the problem basically requires inventing some specialized fast language and mapping it to the machine at hand.

Re: Computer Science from the Bottom Up (2013)

#147

Earlier quoted context omitted.

But is the point of your course computer science, or computer engineering. I don't think I'm particularly special, but I have taken just the one computer architecture course as an undergrad (and I don't remember much if any of what I learnt), and now I just completed the first sem of my PhD in computer science. I haven't used the information I learnt in that class yet, even though I'm in a partially applied field (se…

Well you're not going to like when I say this. Cryptography isn't Computer Science. It uses some things that Computer Science developed but it isn't Computer Science. It's applied Math. If Cryptography is in CS then Nuclear Reactor Operations is in CS. NRO uses computers for monitoring systems and develops algorithms to detect certian... ahm... undesierable states. That doesn't mean we should move a reactor into the…

... what?

I am not sure what your idea aof cryptography is, but crypto relates to the most basic of questions about computation: what is and isn't efficiently computable, that is, P ?= NP.

You do realise that the origin of the field of Computer Science lies in mathematics, specifically Turing's work, right? By your argument, the entire field of Theoretical Computer Science is ... not a part of computer science. Some how, I think that that's not quite right.

Re: Computer Science from the Bottom Up (2013)

#148

Earlier quoted context omitted.

>"Many also don't even realize they have one built into their browser that is perfectly adequate for satisfying the desires to explore functional programming and general computation principles." Are you referring to Javascript being a LISP dialect here? I've heard this occasionally but I also though that the one predominant feature of LISP was that of homoiconicity which I don't believe applies to Javascript or is th…

JavaScript IS lisp with 1) a new syntax and 2) more things bolted on top that make it a non-LISP language. There are two things under the catagory of JavaScript. The Functional size and the Imperative side. It's the only language in the lisp family that allows you to write both, neither, or some combination in the same program. I say neither because other paradigms can be expressed from within JavaScript that will no…

I can't seem to find this talk anywhere on the internet.

Re: Computer Science from the Bottom Up (2013)

#149

Earlier quoted context omitted.

That's one portion of computer science. Computer science encompases, in my mind, the study, operation, maintnence, and information that is required to perform computing tasks of the modern era. It's no use to know about algorithms and complexity if you only know how to sort punch cards as that isn't a modern day computing task. A computer sceince background inherently implies software development background. This als…

Algorithms and complexity theory are independent of any physical model of computation; they capture what it means to compute . The entire field of theoretical computer science stands as a counterexample to your comment. Computer science is not about software engineering.

Computer science assumes that the code is run on a machine with a very specific set of operations since otherwise you wouldn't be able to calculate time complexity. The set of operations were deliberately chosen to be a reasonable abstraction of a modern computer. Thus computer science would look very differently if computers had different capabilities.

For example, lets say that a new computer could switch places of two blocks of memory in constant time no matter their sizes. That would completely revolutionize computer science since many of our old results hinges on the fact that moving memory takes linear time.

Re: Computer Science from the Bottom Up (2013)

#150

Earlier quoted context omitted.

The exercise isn't to put you ahead of everyone else. It is to get you to see where everyone else came from. I could try and run a marathon but I'm very out of shape. One of my friends can try and run a marathon who isn't out of shape and while they won't win they can still do it and learn from the experiance. The goal isn't to win, it's to learn in this case.

That wasn't my point. My point is, even if you know the theory behind compilers, and maybe have written a few yourself, you probably will have difficulty understanding GCC, Clang, or another production compiler unless you've done work with such a compiler before. That is, your friends' awe of the compiler is not only justified given their skill level, it's also likely justified at your skill level as well (although a…

The awe you're describing and the "awe" of his friends are very different, AFAICT. What you describe is perfectly healthy and reasonable: GCC/etc are unquestionably complex systems that can't be fully understood without thorough long-term study and experience. Oversimplifying them would be reckless, and so the average user of them should possess a certain awe and respect for them.

But this is different from having no conception of how compilers work and how one might implement one. As complex as modern compilers are, the foundational principles still apply to them, and an understanding of these principles makes them much less awe-inspiring. I think that having a clear view of the big picture, rather than having certain areas of the picture blocked off entirely as magical black boxes, allows for better engineering choices.

Post reply on HN