Live data from Hacker News

Computer Science from the Bottom Up (2013)

bottomupcs.com

71–80 of 161 posts

Re: Computer Science from the Bottom Up (2013)

#71
post #5

I've been rattling this idea around in my head and, although it may sound crazy, I think C is a little high level to start an adult out on. I know many people won't agree with this but all of the people I admire in the world of CS and everyone who is a true scottsman for all intents and purposes loves dipping down to a lower level once and a while. I think the best way to learn about computer science it to program fo…

What is the point in copying hex values?

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 values will give the student many important skills. At first they will learn to recognize errors in the hex by identifying opcodes for the instruction set you are using. IIRC 0xEB amd 0xEA is a jmp. Secondly they will understand how the assebmly is turned into code executable by the CPU. 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.

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 anyone doing computer science in the real world (and if you're paying >10k/semester at college you should know how to do it!).

Getting a feal for what is really happening under the hood, just numbers being read, run, and repeat will help you understand how to write a compiler.

Again, I can tell you all this and give you a chart to memorize and say "THIS WILL HELP YOU" or I can let you natrually tackel your tasks and allow you, on your own time, to find out what helps you get the job done.

The one thing that isn't negotiable is giving you tasks that incrementally will challange you but not scare you away. What is negotiable is how these are presented. I feel they should be unseen tasks hidden undernethe something that looks like something else to the student.

Re: Computer Science from the Bottom Up (2013)

#72
First impression was wow, I've forgotten how much I've learned over the years. You would learn a lot this way.

However it's hard to call it computer science without specific attention to data structures and algorithms. What about information theory, networking, database systems, and some kind of AI related course?

Re: Computer Science from the Bottom Up (2013)

#73

Earlier quoted context omitted.

> Increasingly today the underlying architecture, for most intents, is becoming irrelevant ... amidst cries from a handful of lunatics who insist we shouldn't be using linked lists any more because they don't use the L1 cache very well compared to arrays.

In some contexts this optimizations make no sense. In others you'd be laughed out of the office for suggesting that you should use a linked list. You'd be shitcanned before you got back to your office. In the same sense if you're in a python shop doing web development and you say "EVERYONE we need to STOP using python and write ALL of our HTTP code in C! We'll be able to optimize the hell out of it and probably save…

Yep. Totally.

Also, if you're working in an HLL, know how LL is implemented in your PL. Because even in Lisp, not all LLs are created equal, and even if you create them the same way, they don't necessarily have the same perf characteristics.

For instance, because Haskell, ML, and the other functional languages don't allow datastructure mutation, they can CDR-code all their lists, something Lisp does as well (which is why list literals created with QUOTE cannot be modified, IIRC). This collpses the linked list structure into something resembling an array, increasing cache response time. Additional conses will be allocated separately, but this will still increase efficiency.

Re: Computer Science from the Bottom Up (2013)

#74
post #5

I've been rattling this idea around in my head and, although it may sound crazy, I think C is a little high level to start an adult out on. I know many people won't agree with this but all of the people I admire in the world of CS and everyone who is a true scottsman for all intents and purposes loves dipping down to a lower level once and a while. I think the best way to learn about computer science it to program fo…

That may be the ideal way to learn CS, but the problem IMO is that lots of people are going to lose interest immediately. When you start with a web app or a game they can immediately feel like they are developing a practical skill.

Re: Computer Science from the Bottom Up (2013)

#75
post #65

Earlier quoted context omitted.

Computer science is not about computers; where does stuff like algorithms fit into this? What is a "true scottsman" of CS? Low level programmers? What about people that have pioneered the theory of computer science? The likes of Karp, Valiant, Cook, Blum, Vazirani, Papdimitriou, Micali, Goldwasser, Goldreich, Shamir, Rivest and etc.? I doubt these people know the inner workings of computers, but they have revolutioni…

Maybe I am too old, but from my vantage point, "Computer Science" and "Algorithmic Science" are really two entirely separate fields. Computer Science is exactly what the OP talks about: computers, CPUs, implementation details, hardware, plumbing, etc... One needs actual hardware on the table to work this out. Imperfect hardware, with latencies, clock issues, etc... THAT is true computer science, IMHO, and is very nea…

Science is the pursuit of truth, whereas engineering is the art of balancing resources and time to achieve a concrete goal (like a product). In that sense, Computer Science is the pursuit of observing, classifying, and predicting of computation phenomena, whereas Computer Engineering is the actual practical matter of building things that take advantage of computation phenomena.

Re: Computer Science from the Bottom Up (2013)

#76

Earlier quoted context omitted.

Errrr, how is this lunacy? Seems like something everyone should be aware of.

It is, but if you're, say, writing a small-scale webapp or some other app that's disk-bound (99% of all applications), it's probably not something you'll have to worry about.

Right but what's the reason not to pick a data structure with better performance? This should be a really trivial choice with virtually 0 impact on code since a list and array will have nearly if not entirely the same interface.

I would also challenge that 99% of all applications are disk bound but I think it's really besides the point. Really, the argument is that performance doesn't matter in all situations, which is true, but hardly means that we should be against writing fast software.

Re: Computer Science from the Bottom Up (2013)

#77

Earlier quoted context omitted.

If you have an audience that is even interested in C (they came specifically to learn about it) it is probably safe to assume that they are interested in lower levels of tech simply by the popular association between C and that. People benefit from context. A "how stuff is made" tour might help. I would show the newbies all the steps: how we start with a piece of C source, and go to executable. Here is a simple progr…

That is very top down. This is perfectly fine and the only reason why I think differently is because most of my peers are afraid of experimenting. They think everything they haven't seen is magic.... because well it seems that way. It's voodoo to them. When I see a compiler I just think "pfft, tokenizer, lexer, tree". When they see a compiler they think "I could never understand this in my life". It's like when I go…

>When I see a compiler I just think "pfft, tokenizer, lexer, tree". When they see a compiler they think "I could never understand this in my life".

To be fair, they're probably more correct in this context. Even if you understand the basics of compilation (and by the way, if you're reading this comment and you don't have a basic understanding of how compilation works, you should go learn that. Like, right now, if you can) the chance of you actually understanding the entirety of GCC and/or Clang without taking three years to study them is pretty slim, AFAICT.

Re: Computer Science from the Bottom Up (2013)

#79
post #65

Earlier quoted context omitted.

Computer science is not about computers; where does stuff like algorithms fit into this? What is a "true scottsman" of CS? Low level programmers? What about people that have pioneered the theory of computer science? The likes of Karp, Valiant, Cook, Blum, Vazirani, Papdimitriou, Micali, Goldwasser, Goldreich, Shamir, Rivest and etc.? I doubt these people know the inner workings of computers, but they have revolutioni…

Maybe I am too old, but from my vantage point, "Computer Science" and "Algorithmic Science" are really two entirely separate fields. Computer Science is exactly what the OP talks about: computers, CPUs, implementation details, hardware, plumbing, etc... One needs actual hardware on the table to work this out. Imperfect hardware, with latencies, clock issues, etc... THAT is true computer science, IMHO, and is very nea…

I was using today's nomenclature, where computer engineering refers to the low level architecture stuff, and computer science to the higher level things.

Re: Computer Science from the Bottom Up (2013)

#80

Earlier quoted context omitted.

Great explanation: you just described the perfect 9-12 year education for the future software developers or even a "STEM track" for those so inclined.

I'm worried that it may just be my love for microcomputers, old mainframes, and just computers in general that is clouding my judgement but I think this would really improve the understanding of computational systems for anyone who was so inclined to participate in the course(s) required to teach this material. Much like the steriotipical sex-ed course where students are made to carry a baby I think college CS studen…

I agree. You have to learn from both directions: go read SICP, PLAI, TAPL, PAIP, Dragon, Algorithms, and whatever else so you have an understanding of the concepts.

Now build a Z80 or 6502-based computer (at the very least) and implement stuff on the bare metal so that you understand how the machine works, at least on a basic level.

But if you can't be bothered to actually build a computer yourself (which is completely understandable), and still want to get a feel for hardware, write some games for an old game console. I recommend the Gameboy: it's dirt cheap (~$20 for a GBA), you can buy a flashcart + reader/writer and/or SD cart from BennVenn for ~$80-$100 (although you may have to wait a bit until he restocks), it's well documented (the PanDoc and numerous tutorials can help you out), and the toolchain is widely available (actually, several toolchains are widely available: various forks of the now-dead RGBDS, and WLA-DX, which seems to be more lively, so it's what I'd reccomend).

Post reply on HN