supercilious
Posts: 5
Joined: Wed Oct 12, 2011 5:57 pm

Re: Design choices behind the RPi

Tue Jan 31, 2012 2:37 pm

Hi,

I know its far too late to be discussing this, but I have been very excited about the Pi since I first read about it ages ago, and now that its nearly here, I thought I'd give some thought to the things I might want to do with them.

So I decided to set up a VM with a similar Linux environment and started to play around with it. What I discovered was very disappointing indeed. With only 256MB of RAM, the system was not usable for anything but the most basic of tasks. By the time the system was booted, there was about 200MB of RAM for userspace code (at best, with a custom minimal kernel and minimal glibc+basesystem build), bearing in mind that this is without any GPU (the VMware GPU has dedicated memory, unlike the RPi). With the GPU there would be even less RAM available, even the smallest possible 1080p framebuffer is about 8MB, and you would need at least 2 such buffers to pageflip.

I'm curious as to what the RPi folks envision people will do with this system? I found it unable to run even simple Python programs for solving the project Euler problems. (Python3, but I don't think Python2 is much less RAM hungry). Trying to compile anything resembling modern C++ like a handful of simple games I wrote for my nephew to play/code with resulted in the OOM killer killing cc1plus. Perhaps clang can help there, but there is no way GCC is an option with only 200MB of RAM available. I can't seriously imagine kids learning to use a cross-compiler from a real computer just to get a simple game running.

Basically, I found myself struggling to find a way to use such a small device in any way that might appeal to someone wishing to learn more about computers. I had hoped to buy several, and give one to my nephew to play with and (hopefully) learn programming. But from everything my experience with the tiny VM has taught me, I might be better off simply buying a regular computer so that I can shove at least 2GB of RAM into it. It just doesn't seem like its worth sacrificing all the nice programming languages, tools, compilers and IDEs just to save a few MB of RAM. Not when 8GB is around £30. Even my phone has 1GB of RAM and its quite old already

Sadly, despite my initial high hopes for this project, I think I will skip the RPi and just buy him a nice regular PC and teach him to use virtual machines to experiment. Maybe the RPi will find its niche with hardware hackers looking for something more capable than an Arduino.

User avatar
meltwater
Posts: 1014
Joined: Tue Oct 18, 2011 11:38 am

Re: Design choices behind the RPi

Tue Jan 31, 2012 3:07 pm

I guess writing a full game in 48k would be a little mad wouldn't it...

But you are right, it is limited, in particular the price which is the point really.

Have you considered interfacing with hardware an option for learning about low level programming instead.

But you are probably right, for what you want, a full blown PC with lots of resources are ideal, and you can do a lot more with it.  It's down to what fits your needs really.
______________
http://www.themagpi.com/
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam

TonyHoyle
Posts: 25
Joined: Thu Nov 24, 2011 3:34 pm

Re: Design choices behind the RPi

Tue Jan 31, 2012 3:07 pm

200mb is more than enough to compile simple programs and get started - It's not *that* long ago that I was running entire GUI setups on 64mb (kde, before it got too bloated) - and compiling kernels under that too (slowly!).  It's plenty.

Someone learning will more than likely start with something like python - although the videos already posted are showing what can be done once you get beyond that and get into graphics... editing the GL code in real time and seeing the results is really cool.

You can't take a VM into school to show your mates, you can't easily make it print 'fred is a pansy' 1000 times without your parents finding out.. and if you break a regular PC it's going to cost a bit more than £25 to replace it.  The Pi is just the right side of 'cool toy' for people who were previously a bit worried or forbidden from mucking with the family PC to get into it and find out how much fun it can be.

WereCatf
Posts: 89
Joined: Thu Jan 26, 2012 7:16 am
Contact: Website

Re: Design choices behind the RPi

Tue Jan 31, 2012 3:09 pm

supercilious said:

Trying to compile anything resembling modern C++ like a handful of simple games I wrote for my nephew to play/code with resulted in the OOM killer killing cc1plus. Perhaps clang can help there, but there is no way GCC is an option with only 200MB of RAM available. I can't seriously imagine kids learning to use a cross-compiler from a real computer just to get a simple game running.
First of all, you're supposed to have swap enabled. You clearly didn't have swap.

Secondly, you are indeed supposed to cross-compile most of the stuff. You can of course compile on RPi itself, too, but you really should have swap for that as 256M simply isn't enough to compile much. Even with swap enabled it'll take quite long to compile anything on a 700MHz system, though.


Basically, I found myself struggling to find a way to use such a small device in any way that might appeal to someone wishing to learn more about computers.


Perhaps RPi just simply isn't for you, then? I myself have absolutely no experience with ARM platform, so RPi will make a very nice, small device for me to play with and practice stuff, including ARM assembly code. And again, with OpenVG support and such it'll be fast and easy to try out all kinds of graphical tasks, one could for example see about developing a small game completely rendered in vector graphics.


Sadly, despite my initial high hopes for this project, I think I will skip the RPi and just buy him a nice regular PC and teach him to use virtual machines to experiment.


Do that if you feel like it. If you expect some other response then atleast I cannot provide such, I am not going to try and push RPi to people who don't want it.

bredman
Posts: 1415
Joined: Tue Jan 17, 2012 2:38 pm

Re: Design choices behind the RPi

Tue Jan 31, 2012 3:23 pm

You can do plenty in 256MB.

I regularly work on a 266Mhz ARM5 with 32MB of RAM. I use gcc for everything and I have never felt the need to cross-compile. I prefer to do everything onboard.

When I was young, I wanted a ZX81 with a whole 1KB or RAM, but I didn't get it.

Young people don't know how good they have it.

WereCatf
Posts: 89
Joined: Thu Jan 26, 2012 7:16 am
Contact: Website

Re: Design choices behind the RPi

Tue Jan 31, 2012 3:30 pm

bredman said:


You can do plenty in 256MB.

I regularly work on a 266Mhz ARM5 with 32MB of RAM. I use gcc for everything and I have never felt the need to cross-compile. I prefer to do everything onboard.

When I was young, I wanted a ZX81 with a whole 1KB or RAM, but I didn't get it.

Young people don't know how good they have it.



I have a whole gigabyte of RAM on my Android tablet, dual-core Tegra2 and all, yet my mobile phone with 256MB RAM and single-core CPU still outperforms it, especially in responsivity; it's not about how much resources you have, it's about how you use them.

supercilious
Posts: 5
Joined: Wed Oct 12, 2011 5:57 pm

Re: Design choices behind the RPi

Tue Jan 31, 2012 3:54 pm

Wow, lots of responses

Firstly, I should clarify. I am very well aware that 200MB CAN be put to use... I have programmed Z80 assembler for my TI-83 calculator with a whopping 32KB of RAM (26KB usable). I even managed to make a near perfect clone of Gameboy tetris for it (except sound obviously), using all sorts of neat tricks like rapidly flipping drawing of blocks to simulate grayscale on a monochrome screen and such. I even overclocked it from 4MHz to 12MHz (I think) by soldering a capacitor and doing crazy stuff I don't even remember now...

I am certain people so inclined will find a way to use the RPi somehow, but I can't see its appeal to someone like my nephew, who is young enough to *expect* a nicer environment than that. He is just starting to learn programming and for him, the niceties of modern tools are simply a given. On a system like the RPi, there are no such tools and he will have to cope without them, and that I fear will deter him from learning programming.

It relatively late in a programmers development that the appreciation of tiny resource constrained environments really comes. I know I would never have found any interest in writing code for a simple calculator were it not for the fact that I had already learned a great deal writing stuff for the PC. First simple hello world stuff, and later system level code and eventually a tiny real mode bootloader and a toy OS. Without attaining that level of confidence, even simple stuff like the command line (which I cannot live without today) was alienating to me.

Therefore, I'm curious how the RPi can attract the attention and interest of newbies to programming? In my very simple and unscientific test, it has failed to live up to the expectations I had largely due to the tiny amount of RAM. I'm willing to accept that my expectations were wrong, so what are yours and those of the RPi devs? What do you see kids doing with these devices?

supercilious
Posts: 5
Joined: Wed Oct 12, 2011 5:57 pm

Re: Design choices behind the RPi

Tue Jan 31, 2012 4:01 pm

TonyHoyle said:


200mb is more than enough to compile simple programs and get started - It's not *that* long ago that I was running entire GUI setups on 64mb (kde, before it got too bloated) - and compiling kernels under that too (slowly!).  It's plenty.


I struggled to compile most C++ code I tried. C was fine though. Modern compilers are more resource intensive that they were back then I suppose.


Someone learning will more than likely start with something like python - although the videos already posted are showing what can be done once you get beyond that and get into graphics... editing the GL code in real time and seeing the results is really cool.

You can't take a VM into school to show your mates, you can't easily make it print 'fred is a pansy' 1000 times without your parents finding out.. and if you break a regular PC it's going to cost a bit more than £25 to replace it.  The Pi is just the right side of 'cool toy' for people who were previously a bit worried or forbidden from mucking with the family PC to get into it and find out how much fun it can be.


He already uses VMware player. I occasionally send him VMs loaded up with simple games and puzzles. He is working is way through project Euler problems at the moment in Python, and some of those scripts use more than 200MB of RAM and invoked the OOM killer in my tests.

I don't think a USB stick with a bunch of VMs is harder to carry around than an RPi. Not that I think he'll be carrying it around...

WereCatf
Posts: 89
Joined: Thu Jan 26, 2012 7:16 am
Contact: Website

Re: Design choices behind the RPi

Tue Jan 31, 2012 4:06 pm

supercilious said:

I'm willing to accept that my expectations were wrong, so what are yours and those of the RPi devs? What do you see kids doing with these devices?
Not all kids are allowed to toy around installing their own OSes or such on the family PC, whereas on RPi they can do anything they feel like. As such I expect them to first learn about basic Linux tasks all the way from installing one on such a device, learning in the process how such things such as CPU speed and RAM size can be limiting factors and how one has to learn to adjust to those limits. In the process of learning all that such a kid is likely to pick up some console skills, possibly later on some shell scripting, and from there it's quite easy to introduce them to Python, C++ and so on.

Ie. I personally see the whole process of learning all the internals and restrictions as much more important than just going straight to studying a programming language and my expectations reflect that idea.

supercilious
Posts: 5
Joined: Wed Oct 12, 2011 5:57 pm

Re: Design choices behind the RPi

Tue Jan 31, 2012 4:10 pm

WereCatf said:


First of all, you're supposed to have swap enabled. You clearly didn't have swap.

Secondly, you are indeed supposed to cross-compile most of the stuff. You can of course compile on RPi itself, too, but you really should have swap for that as 256M simply isn't enough to compile much. Even with swap enabled it'll take quite long to compile anything on a 700MHz system, though.


I tried with swap, and the machine simply went into a swap storm... so I disabled it. I don't think waiting half an hour for the compiler is worth it anyway.


Perhaps RPi just simply isn't for you, then? I myself have absolutely no experience with ARM platform, so RPi will make a very nice, small device for me to play with and practice stuff, including ARM assembly code. And again, with OpenVG support and such it'll be fast and easy to try out all kinds of graphical tasks, one could for example see about developing a small game completely rendered in vector graphics.


I didn't have any experience with the ARM platform either at the time I read about the RPi first, but since then I have got an android phone and have written dozens of apps for ARM, including native code to use the NEON instructions. I don't think that that is of too much interest to kids just starting out learning programming though.


Do that if you feel like it. If you expect some other response then atleast I cannot provide such, I am not going to try and push RPi to people who don't want it.


Sheesh. I didn't expect such hostility.... I was soliciting information about what motivated the particular design choices that the RPi team made. I know the targeted cost constrained them a lot, but it seems like they had different things in mind about teaching kids than I did.

User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Design choices behind the RPi

Tue Jan 31, 2012 4:22 pm

supercilious said:



Do that if you feel like it. If you expect some other response then atleast I cannot provide such, I am not going to try and push RPi to people who don't want it.


Sheesh. I didn't expect such hostility.... I was soliciting information about what motivated the particular design choices that the RPi team made. I know the targeted cost constrained them a lot, but it seems like they had different things in mind about teaching kids than I did.



Indeed, let's remember to play nicely here.  Extra nicely in fact.  the internet can add inflection that you didn't intend or ever consider it could come across as, so be sure to be careful with your words

Ultimately it doesn't matter if someone has a different image than someone else does about how to best use the r-pi.  The things that are good will rise and endure and the ones that don't, well it didn't hurt to try and at least you're out there trying to teach kids at all!
Dear forum: Play nice ;-)

WereCatf
Posts: 89
Joined: Thu Jan 26, 2012 7:16 am
Contact: Website

Re: Design choices behind the RPi

Tue Jan 31, 2012 4:29 pm

^ and ^^ : I didn't mean it to be hostile, you're reading too much into it. I am simply saying that if you feel it doesn't fit for your needs then accept that and move on, it benefits no one to try to push RPi on people whom it doesn't suit. It is all about what you expect and what you need and not everyone has the same requirements, simple as that.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23709
Joined: Sat Jul 30, 2011 7:41 pm

Re: Design choices behind the RPi

Tue Jan 31, 2012 4:32 pm

I built Stellarium, which is a pretty big C/C++program  on the Raspi alpha device, 256MB, no cross compiling. It took ages to build (5hrs vs 10 minutes on my twin core Ahtlon desktop with 4GB), but it completed without failing.

Not sure why you had so much trouble compiling simpler code.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23709
Joined: Sat Jul 30, 2011 7:41 pm

Re: Design choices behind the RPi

Tue Jan 31, 2012 4:34 pm

supercilious said:


I tried with swap, and the machine simply went into a swap storm... so I disabled it. I don't think waiting half an hour for the compiler is worth it anyway.


different things in mind about teaching kids than I did.



Remember the 70/80/90's? Where you had to wait hours for your compiles to come back.

People today, they don't know they're born.....
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

tufty
Posts: 1456
Joined: Sun Sep 11, 2011 2:32 pm

Re: Design choices behind the RPi

Tue Jan 31, 2012 4:43 pm

In my first job, we had to wait 3 days for source code checkouts. Literally, 3 business days. Work out what you need from the read-only repository, fill in a source code access form, stick it in the internal post, wait 3 business days for your checked out code to appear.

/And/ we had to deal with JCL.

Give me slow compiles any day

Simon

User avatar
ArborealSeer
Posts: 300
Joined: Tue Jan 24, 2012 9:48 am
Location: South West, UK

Re: Design choices behind the RPi

Tue Jan 31, 2012 4:48 pm

I'm a bit concerned now as C++ development is one of the core things I'm planning to use my RPi for.

Of course I assume there are ways around this, like precompiled headers / libraries to ease the pain, but for the most part I don't anticipate that large of a project.



JamesH can you give a more normal example for something like standard OpenGL ES SDK demo?

I don't have other linux boxes to cross-compile on (successful use of RPi may change that.. if RPi acts as a gateway drug )
Pi Status > Farnell, Arrived 24/5- RS, Arrived 1/6

gimliflea
Posts: 76
Joined: Fri Nov 18, 2011 4:14 pm

Re: Design choices behind the RPi

Tue Jan 31, 2012 4:49 pm

Having developed various emulations myself I really don't trust them

I'll make up my mind when I've tried the real thing.

Soon I hope.

supercilious
Posts: 5
Joined: Wed Oct 12, 2011 5:57 pm

Re: Design choices behind the RPi

Tue Jan 31, 2012 4:52 pm

JamesH said:


Remember the 70/80/90's? Where you had to wait hours for your compiles to come back.

People today, they don't know they're born.....


Heh, at work, we still have to deal with 40-50 minute build times. Thats despite farming out the compiling across a farm of blade servers stuffed with dozens of Xeon 5520s and enterprise SSDs. Thats without running the test suites. Luckily most builds don't require re-compiling everything or we would be tearing our hair out

I just meant that waiting for a compiler is not appropriate for kids since its too easy for them to give up and lose interest without immediate (and ideally visual) feedback. The Java stuff my nephew is learning in school for example uses the netbeans IDE and it compiles the current class on every keystroke, and compiles most small projects entirely within milliseconds. Its that kind of stuff that I think makes programming more accessible. When you can see the IDE highlight your missing semicolon, or see the squiggly underline on your typo without hitting any buttons

User avatar
RaTTuS
Posts: 10460
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Design choices behind the RPi

Tue Jan 31, 2012 5:05 pm

http://www.xoreax.com/visual_studio.htm Incredibuild FTW - if your lucky
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

User avatar
piglet
Posts: 909
Joined: Sat Aug 27, 2011 1:16 pm

Re: Design choices behind the RPi

Tue Jan 31, 2012 5:06 pm

I just missed out on punch cards. I work with people who had the pleasure of them.

I'm still amazed how productive we were on clunky old mainframe terminals without even copy or paste, let alone a mouse.

error404
Posts: 351
Joined: Wed Dec 21, 2011 11:49 pm

Re: Design choices behind the RPi

Tue Jan 31, 2012 5:38 pm

RaTTuS said:


http://www.xoreax.com/visual_studio.htm Incredibuild FTW - if your lucky



Or in context more useful, http://code.google.com/p/distcc/

drgeoff
Posts: 9819
Joined: Wed Jan 25, 2012 6:39 pm

Re: Design choices behind the RPi

Tue Jan 31, 2012 6:19 pm

I learned a lot from my MK14.  256 bytes RAM and 512 bytes ROM.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23709
Joined: Sat Jul 30, 2011 7:41 pm

Re: Design choices behind the RPi

Tue Jan 31, 2012 8:09 pm

ArborealSeer said:


I'm a bit concerned now as C++ development is one of the core things I'm planning to use my RPi for.

Of course I assume there are ways around this, like precompiled headers / libraries to ease the pain, but for the most part I don't anticipate that large of a project.



JamesH can you give a more normal example for something like standard OpenGL ES SDK demo?

I don't have other linux boxes to cross-compile on (successful use of RPi may change that.. if RPi acts as a gateway drug )


I don't have any real world figures, but when I was compiling the various performance test apps, which admittedly were C not C++, they were a couple of seconds compile and link IIRC.

Remember this is a single 700Mhz Arm, not a quad core 3GHz hyperthreaded monster. It's not going to be as fast!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

TheEponymousBob
Posts: 205
Joined: Mon Jan 02, 2012 5:05 am
Contact: Website

Re: Design choices behind the RPi

Tue Jan 31, 2012 8:27 pm

ArborealSeer said:

I don"t have other linux boxes to cross-compile on (successful use of RPi may change that.. if RPi acts as a gateway drug )


Assuming it"s the Linux, rather than the box, that you are missing, you might consider running Linux on a virtual machine hosted on another box. At risk of heresy, I"ve never quite got on with Linux as a desktop OS, but quite regularly spin up virtual machines for noodling on.

User avatar
ArborealSeer
Posts: 300
Joined: Tue Jan 24, 2012 9:48 am
Location: South West, UK

Re: Design choices behind the RPi

Tue Jan 31, 2012 8:34 pm

Hah yeah.. I have other uses for those though.. muhahaha!



JamesH said:


I don't have any real world figures, but when I was compiling the various performance test apps, which admittedly were C not C++, they were a couple of seconds compile and link IIRC.

Remember this is a single 700Mhz Arm, not a quad core 3GHz hyperthreaded monster. It's not going to be as fast!


Oh don't worry, i'm far from one of these expecting a ferrari for skoda prices.. and I do fully appreciate that the OP has several glaring holes in logic and set up – as pointed out by many others. (not on the same hardware, not even the right instruction set, badly configured environment and more..)

Your results from the performance test apps sounds great.. my planned app isn't going to be anywhere as complicated – maybe far cooler, and possibly more educationally inspiring (I hope) though hah! (and simple versions are easily producable in python etc.) its just that i'm hoping to supercharge a couple things in a massively over-engineered superbly self indulgent way.. Just a shame I don't have the time to invest like I did when I was a student many moons ago.

Faith restored.
Pi Status > Farnell, Arrived 24/5- RS, Arrived 1/6

Return to “General discussion”