Search found 324 matches
- Tue Feb 12, 2013 11:34 pm
- Forum: Staffroom, classroom and projects
- Topic: Assembly - any use in teaching it?
- Replies: 138
- Views: 40269
Re: Assembly - any use in teaching it?
For that reason "*p++ = *p++ + y" can't be converted to "*p++ += y". In C, at least, it can. You have two assignments to p with no intervening sequence point there, so the behaviour is undefined, and the compiler can emit whatever it likes. Good catch! But there is such a thing ...
- Tue Feb 12, 2013 6:30 pm
- Forum: Staffroom, classroom and projects
- Topic: Assembly - any use in teaching it?
- Replies: 138
- Views: 40269
Re: Assembly - any use in teaching it?
... I've seen a compiler take "x += y" and calculate the address of x twice, and it was a complex array access so non-trivial. OK, when I switched on optimisation it got it right, but it would have worked just as well with "x = x + y". Yikes! That's a compiler error. What if the...
- Tue Feb 12, 2013 6:11 pm
- Forum: Staffroom, classroom and projects
- Topic: BASIC - more harmful than useful?
- Replies: 899
- Views: 178194
Re: BASIC - more harmful than useful?
Or are you saying that . is a low level operator? I believe that CAR, CDR, CONS are the lowest level operators, and that . is in fact a function of the input parser and output formatter. Indeed. The low level memory allocator in a pure lisp (i.e. one without additional low level data types like arr...
- Mon Feb 11, 2013 7:30 pm
- Forum: Staffroom, classroom and projects
- Topic: BASIC - more harmful than useful?
- Replies: 899
- Views: 178194
Re: BASIC - more harmful than useful?
Lisp is stack based, and thus slower and slower as you build it up. Actually most programming languages are "stack based". If anything Lisp is far less stack based than C/C++, Pascal, Fortran, Ada, etc. etc. etc because it supports first class functions (basically a function can be used o...
- Sat Feb 09, 2013 12:33 am
- Forum: Linux Kernel
- Topic: Time to compile the kernel
- Replies: 16
- Views: 8990
Time to compile the kernel
Just curious. How long does it take to compile the RPi linux kernel on an RPi? And to cross compile on a fast Intel/amd 64bit processor? And can you cross-compile a kernel for another platform on the RPi? For comparison, here are some plan9 numbers: rpi; pwd /sys/src/nix/k10 #time to cross compile a...
- Fri Feb 08, 2013 11:23 pm
- Forum: General discussion
- Topic: Is PI a good choice for prototyping a commercial product?
- Replies: 11
- Views: 3753
Re: Is PI a good choice for prototyping a commercial product
commercial product that employs a re-sold microprocessor board... a big issue is warranty costs and warranty pass-through. No to mention that the RPi may be suboptimal in other ways: power use, form factor, needing to put your electronics on a separate board, limited interface bandwidth in that cas...
- Fri Feb 08, 2013 8:30 pm
- Forum: Staffroom, classroom and projects
- Topic: Assembly - any use in teaching it?
- Replies: 138
- Views: 40269
Re: Assembly - any use in teaching it?
Alan Perlis once quipped that a Lisp programmer knows the value of everything but the cost of nothing. More or less the same can be true of anyone who only uses high level languages. If you want to find out how much some part of your program costs in terms of space or cpu cycles, it helps to look at...
- Thu Feb 07, 2013 7:39 pm
- Forum: Staffroom, classroom and projects
- Topic: BASIC - more harmful than useful?
- Replies: 899
- Views: 178194
Re: BASIC - more harmful than useful?
Ok, guys & girls, how about a programming challenge to settle this once and for all ? [Yeah, right!] Program it in the language of your choice to show off your programming chops! The challenge: Write a program that places the *minimum* number of knights on a chessboard such that a given square e...
- Thu Feb 07, 2013 5:52 pm
- Forum: General discussion
- Topic: Power switch now available for Pi
- Replies: 48
- Views: 40725
Re: Power switch now available for Pi
You plug your original Pi power supply (male micro USB) into the switch. Then use a standard USB->micro-USB from the switch to the Pi's power port. The GPIO pins are only used for communication, not powering the Pi. One lead sends a signal to the Pi and the other lead receives a signal from the Pi....
- Wed Feb 06, 2013 10:10 pm
- Forum: Staffroom, classroom and projects
- Topic: BASIC - more harmful than useful?
- Replies: 899
- Views: 178194
Re: BASIC - more harmful than useful?
In practice you can get away not knowing a lot of the theory but the parsing theory is not exactly simple. Check out the "Dragon book" on compilers! I am very familuar with the 'Dragon Book": Principles of Compiler Design . Two things about your statement: 1) The dragon book presents...
- Wed Feb 06, 2013 9:42 pm
- Forum: Staffroom, classroom and projects
- Topic: BASIC - more harmful than useful?
- Replies: 899
- Views: 178194
Re: BASIC - more harmful than useful?
Angels and pinheads. I first wrote an interpreter for BASIC more years ago than I care to remember. It was limited to 26 variables, rather imaginitively called A to Z. I programmed it into a 2708 EPROM (I also had to create the hardware to program the EPROM). Less than 2000 bytes for the interperte...
- Wed Feb 06, 2013 9:36 pm
- Forum: General discussion
- Topic: An interesting little difference in file handling ...
- Replies: 7
- Views: 1875
Re: An interesting little difference in file handling ...
Each month, I concatenate the 30 or 31 files into a single file. This is done at a Windows Command Window by navigation to the directory on the mapped drive, and typing the following command, for example, for January 2013: type 201301??.txt >> 201301.txt So here is the "interesting little diff...
- Wed Feb 06, 2013 5:53 pm
- Forum: Staffroom, classroom and projects
- Topic: BASIC - more harmful than useful?
- Replies: 899
- Views: 178194
Re: BASIC - more harmful than useful?
Parsing is presented as hard , in fact parsing is extremely simple. In practice you can get away not knowing a lot of the theory but the parsing theory is not exactly simple. Check out the "Dragon book" on compilers! And using a language that will hide everything and teach nothing is nons...
- Wed Feb 06, 2013 5:01 pm
- Forum: Staffroom, classroom and projects
- Topic: 'Visualizing Code to Fail Faster' - Inventing on Principle.
- Replies: 6
- Views: 2297
Re: 'Visualizing Code to Fail Faster' - Inventing on Princip
aTao, do watch Brett Victor's talk! What he is talking about is several levels above "semicolon expected". And it is heads and shoulders above Eclipse.
- Wed Feb 06, 2013 4:35 pm
- Forum: Staffroom, classroom and projects
- Topic: BASIC - more harmful than useful?
- Replies: 899
- Views: 178194
Re: BASIC - more harmful than useful?
Start with a simple typed language and a recursive decent parser type compiler I beg to disagree. You want to leave parsing right out of it, and start by working on the syntax tree direct. Something lisp-like, a language that's already expressed in terms of a syntax tree, would be the best place to...
- Mon Feb 04, 2013 10:51 pm
- Forum: Staffroom, classroom and projects
- Topic: BASIC - more harmful than useful?
- Replies: 899
- Views: 178194
Re: BASIC - more harmful than useful?
It seems to me that you need the ability to edit source code and issue commands. Those are two modes and two windows, unless you go back to line numbers. You can do "windows" in text mode; standard FORTH has the top two thirds of the screen as an editor window and the bottom as a scrollin...
- Thu Jan 31, 2013 10:23 pm
- Forum: HATs and other add-ons
- Topic: Gertboard, RISC OS and BASIC
- Replies: 18
- Views: 8309
Re: Gertboard, RISC OS and BASIC
Tell us more, Gert!Gert van Loo wrote:I recently counted them: I have 6 Pi-related HW projects in parallel which I am responsible for or have to look at on a regular basis.
- Wed Jan 30, 2013 3:15 am
- Forum: Plan 9
- Topic: STICKY: Keeping up to date
- Replies: 5
- Views: 18296
Re: Keeping up to date
But doing a pull, does this update everything (binaries, the kernel, etc.), or just sources, or does it update userspace binaries but just kernel source, or what? Everything that is in /n/sources/plan9/ dir but note that only the 386 bits are built there at present. On the RPi you'll have to rebuil...
- Wed Jan 30, 2013 1:26 am
- Forum: Plan 9
- Topic: STICKY: Keeping up to date
- Replies: 5
- Views: 18296
Re: Keeping up to date
A plan 9 noob here; will this procedure update all the userspace binaries, etc., just the sources or what? How do I completely update everything? (Incidentally I tried to update the kernel and failed miserably; check the backlogs in #plan9, due to soft/hard FPU mismatches!) Standard plan9 sources n...
- Sun Dec 09, 2012 7:12 pm
- Forum: Plan 9
- Topic: Quid pro quo
- Replies: 2
- Views: 12864
Re: Quid pro quo
I got my acct. Liz will have her quid in a bit but it won't be very pro.Florent wrote:I'll be happy to help him out and I'm waiting for my eLinux account request to be approved.
- Sat Dec 08, 2012 9:44 pm
- Forum: Bare metal, Assembly language
- Topic: Bootloader Questions
- Replies: 19
- Views: 7040
Re: Bootloader Questions
The bootloader obviously isn't intended for persistent programs. It's intended for use during the development phase, so that you won't have to copy your program/kernel to the SD card every time you have an update to evaluate. If you want it persistent, just replace the bootloader with your program ...
- Mon Nov 19, 2012 3:56 am
- Forum: Off topic discussion
- Topic: What's wrong with the OS status quo & how to fix it
- Replies: 27
- Views: 4304
Re: Other ARM hardware?
Your assuming that the current OS paradigm is broken, which isn't proved, in my mind anyway. For example, no-one has yet given me a good alternative, or at least explained the alternatives in the words of one syllable I need in order to understand 'paradigm shifts'. And until that happens, the curr...
- Thu Nov 15, 2012 2:20 am
- Forum: Off topic discussion
- Topic: What's wrong with the OS status quo & how to fix it
- Replies: 27
- Views: 4304
Re: Other ARM hardware?
I don't believe anyone has come up with an alternative. The existing file paradigm is pretty limiting, but I have seen nothing that gives the same unity and utility, much less a step change in expressibility or efficiency. Compared to unix the file paradigm has been taken much further in plan9[1]. ...
- Sun Nov 04, 2012 6:28 am
- Forum: Staffroom, classroom and projects
- Topic: APL
- Replies: 10
- Views: 3952
Re: APL
Kona is an open-source implementation of the K programming language. If you don't know APL, then this is the place to start. K is an ASCII-based APL. To build it on the Raspi: $ git clone https://github.com/kevinlawler/kona.git $ cd kona $ make To use: $ rlwrap ./k # rlwrap for history and command l...
- Thu Nov 01, 2012 6:01 pm
- Forum: General discussion
- Topic: RaspberryPi On/Off Switch Idea
- Replies: 81
- Views: 58008
Re: RaspberryPi On/Off Switch Idea
There's also a ready made solution: http://www.pololu.com/catalog/product/751 , I'm not sure if it has the "hold for x seconds to do hard off" or not but in most cases you don't want to do a hard-off to avoid SD card corruption. The circuit I referenced earlier does this. You need an outp...