I love static typing. It makes all the bad problems go away.
I suppose that maybe you were being facetious or sarcastic, or maybe you were simplifying, but static typing hardly "makes all the bad problems go away". Unfortunately, I don't remember who originally said it, so I can't properly attribute it, but, paraphrasing, "static typing is the compiler doing some cursory testing on your code". To raise your level of certainty that your programme is bug-free, you have to do a lot of testing. If you use a statically-typed language, then the compiler will do some testing for you--it'll tell you that every time you call a function, the arguments you pass are the correct type and the return value is stored in a variable of the correct type. It won't tell you whether or not your code contains a logic error. Passing the wrong object to a function is an error in the programmer's reasoning that is, arguably, akin to the traditional kind of logic error that compilers gleefully use to generate segfaults and buffer overruns. To catch these sorts of things you need unit tests and integration tests and the whole shebang.
I think, in the typical case of Javascript in the browser, the fundamental problem is the combination of incompatible implementations, the piss-poor development environment, and the apparently widespread belief that you can write Javascript code by cutting and pasting. For anyone interested in improving their Javascript development environment, I recommed the Venkman debugger (or Firebug, but I've never used it) and Selenium. Venkman (and, apparently, its heir, Firebug) provides a real, honest-to-goodness debugger that supports breakpoints, watchpoints, stack traces, etc. Selenium is a tool for running unit tests within all of the major browsers and it can be automated. (In a past life, I had a script that fired up a virtual X server, launched IE through Wine and ran tests on my app through Selenium. I plugged this into cron and had regular reports of the output emailed to me.)
I disagree with the GP that static typing "makes all the bad problems go away", but your example is disingenuous. Java 1.5 introduced generics to solve exactly the problem you so eloquently described. Of course, any dumbass can ignore compiler warnings and use casts wherever they like, but that's an ID10T error not a language problem.
Perhaps we're wondering off topic here, but, if what you say is true, then what's the difference between licensing a library (ie. a bundle of C/C++ code that is intended to be compiled to a.o file and then linked to some other application) under the GPL vs. the LGPL?
For example, I believe GNU Readline is explicitly GPL and not LGPL whereas glibc is LGPL. IIRC, Readline is GPL because RMS figures it's a pretty awesome library with no closed-source equivalent, so it's a bit of a carrot in the carrot-and-stick game of getting people to switch to Free Software. On the other hand, making glibc LGPL means that closed-source software can be made to run on GPL'd operating systems by using glibc as their C library. If, as you say, the GPL can't cover linking, what stops an entity from writing a closed-source app that links to Readline, but distributes only the Readline source with the otherwise-closed binaries? Have I missed something, or gotten some facts wrong?
I think Wired's simplification is appropriate. My understanding of quantum computing is that a qubit can collapse to a 1, or it can collapse to a 0, or it can be in a superposition of 1 and 0. The one and zero states are pretty easy to understand--they're basically classical. It's the superposition that's the weirdo "state", and it's also the thing that makes quantum computing fundamentally different from classical computing. So, for a magazine that is trying to explain the forefront of quantum computing research to laypeople, I think the simplification to three "states" is a good one.
I think that was meant as an insult, but the AC may be on to something. Although, correlation is not causation. Maybe we're fat because we drive everywhere instead of walking? Who knows.
Dunno about Australia (never been there) but comparing North American cars to European cars makes me wonder why we North Americans need such big cars (I'm Canadian, but I drive a Civic and get about 7.1 L/100km...).
My personal, anecdotal experience with European vs. Canadian car owners is that Canadian cars, on average, are huge compared to the average European car. Probably has something to do with the average fuel economy.
Anyway, I'm off to bed--I doubt any of what I just said has made any sense to anyone but me....
Secondly, why is the parallelizable nature of ray tracing embarrassing?! It's parallelizable exactly because each ray is computed independently of other rays - I don't see what is embarrassing or surprising about that.
It's embarrassing because "Embarrassingly parallel" is the technical term for problems like ray tracing. It's a parallelizable problem wherein the concurrently-executing threads don't need to communicate with each other in order to complete their tasks so the performance of a parallel solution scales almost perfectly linearly with the number of processors that you throw at the problem.
Ian
Re:Genuine question about perl vs ruby
on
Lisp and Ruby
·
· Score: 1
it's slow, and has little support for Unicode (not that surprising, seeing it's from Japan).
I stumbled on that. Why does coming from Japan make it not surprising that it's slow and has little support for Unicode?
Oh and another thing, why the hell do you Americans hold elections on weekdays? Aren't most people at work? Normal people would hold an election on a Saturday...
Dunno how they do it where you're from (Australia based on the compulsory voting?) but here in Canada, your employer is required by law to give you some number of compensated hours (three, I think) to allow you to vote, and the government keeps the polls open before and after the typical working day. So, you can keep your Saturday elections--I want my three hours off.
This comes from a person who's too lazy to get off his butt and vote in an impending municipal election, so take it as you please.
I think not voting and voting while uninformed are both equally heinous. The solution to not voting is voting and the solution to voting while uninformed is to go read something--the newspaper, the internet, a candidate's brochure, whatever. It sounds to me like the problem isn't that you're uninformed, the problem is that you're lazy (like me). So, either get informed, or tell your family that you're too lazy to vote.
Yeah, I guess which part of Canada makes a huge difference--the country is friggin' enormous. What I was trying to imply is that, even though Toronto stays warm because of the lake, I still think this is an awfully warm November.
Of course, as others have mentioned, there's a difference between weather and climate, and I can't tell which this is.
I know (or at least hope) that you're joking, but just for a counterpoint, I also live in Canada and am surprised as hell that I can walk around in a T-shirt in November.
Perhaps I should have used an <em> tag because this is what I meant:
[Starfish] makes distributed grid computing possible in six lines of code.
(Aside: why don't actual <em> tags do anything inside <blockquote> tags?)
Anyway, my point is that the ease with which you can distribute some programs across a grid with Starfish is amazing, at least to me. Also, my naive understanding is that the best problems for solving with a grid are so called "embarassingly parallel" problems and that such problems generally can be expressed in terms of Map and Reduce. Of course, either or both of those two assertions could be false.
The downside, aside from the 100% solvable issue of being able to wake up 1,000 computers in the middle of the night without needing a staff of 80 (which was what it took for our "successful" run), is that programming for a grid is hard and tedious, and none of the frameworks that I am familiar with really take it down to the level where it needs to be for "regular" programmers to be able to do it.
You might want to check out Starfish. It's Google's MapReduce implemented in Ruby, kind of. It makes distributed grid computing possible in six lines of code. Unbelievable, but true.
Ian
PS I've personally got nothing to do with Starfish. I read the author's blog--that's it.
Print Version: 1 page
on
The Expert Mind
·
· Score: 2, Informative
Thanks for the heads-up. Apparently some people complained, some LUGs got involved, and the government actually responded. Linux support was added three days before the filing deadline. Almost restores ones faith in government, eh? Maybe I'll be able to file my details online with no trip-ups in 2011 when they take the next census. Here's hoping.
Well, it didn't work for me. I s'pose I'm not the typical Canadian, but Firefox on Linux is not supported by the 2006 Canadian census (although Firefox on Windows is).
At first I thought it was 'cause I'm running a 64-bit Firefox on AMD64, but even the 32-bit version on my x86 laptop wouldn't let me finish. I tried to bypass their checks using a Firefox plugin that spoofs the User Agent, but then it froze part way through and I lost all my work. I was very frustrated, to say the least, considering it's just a friggin survey and you don't need anything more than SSL and HTML 4.0.
Safety and practicallity:...There actually has been an incident in the past where a student has been killed while testing on a highway. I believe it was in Ontario and maybe by U of T but I'm not certain....
I feel your pain--the photo apps should support multiple root dirs--but have you tried (the possibly obvious choice of) creating a root dir whose contents is just symlinks to your multiple roots?
And how exactly is that a problem? As I understand it, Sergey and Larry together own a majority share in the company, so disconsolate shareholders can't stage a coup, and by selling shares in the first place, GOOG has its money. What does the current share price matter?
I played around with Pandora a little this weekend. You can kind of do what you want with Pandora because it'll let you create up to 100 "stations".
Each station keeps its own set of thumbs-up/thumbs-down votes. You'd have to create stations like "Relaxed", "Bummed", "Hyper", etc. and then choose your station based on your current mood, but it's better than only one playlist.
I actually just graduated from a university CS program and I found that a laptop was useful in nearly all my classes. I used GraphViz for the finite state machines and related diagrams, and I used LyX for the ordinary notes. LyX, in particular, is really good at thinks like mathematical equations and all the Greek that seems prevalent in CS courses. Some times I'd use Dia for diagrams that aren't graphs.
I guess this thread is probably going to devolve into "is too!", "is not!", but I still have all the CS notes I value in soft-copy form and I expect to keep them backed-up for a long time.
It doesn't work. It's not intended for "web pages" that I fully agree should be completely accessible and gracefully degrade. Syndey is intended to be an application framework. Applications come with minimum system requirements, and Sydney's list includes "JavaScript is turned on".
Try Sydney then. The SourceForge page is a little out of date because I've been busy with school/work, but we've done a lot of work at Navtech recently (that's been the work bit of my excuse) to improve Sydney for the live web application we've built on top of it. It gives you combo boxes, tabbed windows, a table widget (a grid control would be an obvious extension to this) and a tree widget, amongst other things, and the Javascript's not crashy.
Other interesting features: cross-browser (works in Moz, IE, Safari, and (probably) Opera--no it doesn't work in Lynx, Emacs, etc.), keyboard support (you can navigate the tree and table widgets with the arrows, etc.), robust library code for managing data-presentation separation, custom context menus, unit test framework modelled after JUnit, and a source cruncher and a server-side include manager for speeding up downloads. I can't remember if any of these features are still only in the Navtech repository, but all the recents in-house improvements will be in the public repository before the end of April, maybe before the middle of April, depending on my final exam schedule.
Sydney works. We've built a complex web application on top of it that consists of more than 90,000 lines (3,000,000 characters) of Javascript (according to `find . -name *.js | xargs wc -l -c`) and several tens of thousand lines of Perl.
I suppose that maybe you were being facetious or sarcastic, or maybe you were simplifying, but static typing hardly "makes all the bad problems go away". Unfortunately, I don't remember who originally said it, so I can't properly attribute it, but, paraphrasing, "static typing is the compiler doing some cursory testing on your code". To raise your level of certainty that your programme is bug-free, you have to do a lot of testing. If you use a statically-typed language, then the compiler will do some testing for you--it'll tell you that every time you call a function, the arguments you pass are the correct type and the return value is stored in a variable of the correct type. It won't tell you whether or not your code contains a logic error. Passing the wrong object to a function is an error in the programmer's reasoning that is, arguably, akin to the traditional kind of logic error that compilers gleefully use to generate segfaults and buffer overruns. To catch these sorts of things you need unit tests and integration tests and the whole shebang.
I think, in the typical case of Javascript in the browser, the fundamental problem is the combination of incompatible implementations, the piss-poor development environment, and the apparently widespread belief that you can write Javascript code by cutting and pasting. For anyone interested in improving their Javascript development environment, I recommed the Venkman debugger (or Firebug, but I've never used it) and Selenium. Venkman (and, apparently, its heir, Firebug) provides a real, honest-to-goodness debugger that supports breakpoints, watchpoints, stack traces, etc. Selenium is a tool for running unit tests within all of the major browsers and it can be automated. (In a past life, I had a script that fired up a virtual X server, launched IE through Wine and ran tests on my app through Selenium. I plugged this into cron and had regular reports of the output emailed to me.)
Ian
I disagree with the GP that static typing "makes all the bad problems go away", but your example is disingenuous. Java 1.5 introduced generics to solve exactly the problem you so eloquently described. Of course, any dumbass can ignore compiler warnings and use casts wherever they like, but that's an ID10T error not a language problem.
Ian
Perhaps we're wondering off topic here, but, if what you say is true, then what's the difference between licensing a library (ie. a bundle of C/C++ code that is intended to be compiled to a .o file and then linked to some other application) under the GPL vs. the LGPL?
For example, I believe GNU Readline is explicitly GPL and not LGPL whereas glibc is LGPL. IIRC, Readline is GPL because RMS figures it's a pretty awesome library with no closed-source equivalent, so it's a bit of a carrot in the carrot-and-stick game of getting people to switch to Free Software. On the other hand, making glibc LGPL means that closed-source software can be made to run on GPL'd operating systems by using glibc as their C library. If, as you say, the GPL can't cover linking, what stops an entity from writing a closed-source app that links to Readline, but distributes only the Readline source with the otherwise-closed binaries? Have I missed something, or gotten some facts wrong?
Ian
I think Wired's simplification is appropriate. My understanding of quantum computing is that a qubit can collapse to a 1, or it can collapse to a 0, or it can be in a superposition of 1 and 0. The one and zero states are pretty easy to understand--they're basically classical. It's the superposition that's the weirdo "state", and it's also the thing that makes quantum computing fundamentally different from classical computing. So, for a magazine that is trying to explain the forefront of quantum computing research to laypeople, I think the simplification to three "states" is a good one.
Ian
I think that was meant as an insult, but the AC may be on to something. Although, correlation is not causation. Maybe we're fat because we drive everywhere instead of walking? Who knows.
Ian
Dunno about Australia (never been there) but comparing North American cars to European cars makes me wonder why we North Americans need such big cars (I'm Canadian, but I drive a Civic and get about 7.1 L/100km...).
My personal, anecdotal experience with European vs. Canadian car owners is that Canadian cars, on average, are huge compared to the average European car. Probably has something to do with the average fuel economy.
Anyway, I'm off to bed--I doubt any of what I just said has made any sense to anyone but me....
Ian
You've obviously never tried to deliver software. Time to delivery approaches a constant greater than zero....
It's embarrassing because "Embarrassingly parallel" is the technical term for problems like ray tracing. It's a parallelizable problem wherein the concurrently-executing threads don't need to communicate with each other in order to complete their tasks so the performance of a parallel solution scales almost perfectly linearly with the number of processors that you throw at the problem.
Ian
I stumbled on that. Why does coming from Japan make it not surprising that it's slow and has little support for Unicode?
Ian
Dunno how they do it where you're from (Australia based on the compulsory voting?) but here in Canada, your employer is required by law to give you some number of compensated hours (three, I think) to allow you to vote, and the government keeps the polls open before and after the typical working day. So, you can keep your Saturday elections--I want my three hours off.
Ian
This comes from a person who's too lazy to get off his butt and vote in an impending municipal election, so take it as you please.
I think not voting and voting while uninformed are both equally heinous. The solution to not voting is voting and the solution to voting while uninformed is to go read something--the newspaper, the internet, a candidate's brochure, whatever. It sounds to me like the problem isn't that you're uninformed, the problem is that you're lazy (like me). So, either get informed, or tell your family that you're too lazy to vote.
Ian
Yeah, I guess which part of Canada makes a huge difference--the country is friggin' enormous. What I was trying to imply is that, even though Toronto stays warm because of the lake, I still think this is an awfully warm November.
Of course, as others have mentioned, there's a difference between weather and climate, and I can't tell which this is.
Ian
I know (or at least hope) that you're joking, but just for a counterpoint, I also live in Canada and am surprised as hell that I can walk around in a T-shirt in November.
Ian
Perhaps I should have used an <em> tag because this is what I meant:
(Aside: why don't actual <em> tags do anything inside <blockquote> tags?)
Anyway, my point is that the ease with which you can distribute some programs across a grid with Starfish is amazing, at least to me. Also, my naive understanding is that the best problems for solving with a grid are so called "embarassingly parallel" problems and that such problems generally can be expressed in terms of Map and Reduce. Of course, either or both of those two assertions could be false.
Ian
You might want to check out Starfish. It's Google's MapReduce implemented in Ruby, kind of. It makes distributed grid computing possible in six lines of code. Unbelievable, but true.
Ian
PS I've personally got nothing to do with Starfish. I read the author's blog--that's it.
In case anyone else prefers one, nearly ad-free, page over 6 skinny pages full of blinky bits.
Thanks for the heads-up. Apparently some people complained, some LUGs got involved, and the government actually responded. Linux support was added three days before the filing deadline. Almost restores ones faith in government, eh? Maybe I'll be able to file my details online with no trip-ups in 2011 when they take the next census. Here's hoping.
Ian
Relevant Newsforge links:
Well, it didn't work for me. I s'pose I'm not the typical Canadian, but Firefox on Linux is not supported by the 2006 Canadian census (although Firefox on Windows is).
At first I thought it was 'cause I'm running a 64-bit Firefox on AMD64, but even the 32-bit version on my x86 laptop wouldn't let me finish. I tried to bypass their checks using a Firefox plugin that spoofs the User Agent, but then it froze part way through and I lost all my work. I was very frustrated, to say the least, considering it's just a friggin survey and you don't need anything more than SSL and HTML 4.0.
Ian
I remembered hearing about that when it happened. Something about wind knocking the car across a divided highway. Here's a link to the CTV version of the story: Solar car goes out of control; driver killed. Also, Google search that actually returns some results.
Ian
I feel your pain--the photo apps should support multiple root dirs--but have you tried (the possibly obvious choice of) creating a root dir whose contents is just symlinks to your multiple roots?
Just my $0.02
Ian
And how exactly is that a problem? As I understand it, Sergey and Larry together own a majority share in the company, so disconsolate shareholders can't stage a coup, and by selling shares in the first place, GOOG has its money. What does the current share price matter?
Ian
I played around with Pandora a little this weekend. You can kind of do what you want with Pandora because it'll let you create up to 100 "stations".
Each station keeps its own set of thumbs-up/thumbs-down votes. You'd have to create stations like "Relaxed", "Bummed", "Hyper", etc. and then choose your station based on your current mood, but it's better than only one playlist.
Ian
I actually just graduated from a university CS program and I found that a laptop was useful in nearly all my classes. I used GraphViz for the finite state machines and related diagrams, and I used LyX for the ordinary notes. LyX, in particular, is really good at thinks like mathematical equations and all the Greek that seems prevalent in CS courses. Some times I'd use Dia for diagrams that aren't graphs.
I guess this thread is probably going to devolve into "is too!", "is not!", but I still have all the CS notes I value in soft-copy form and I expect to keep them backed-up for a long time.
Ian
It doesn't work. It's not intended for "web pages" that I fully agree should be completely accessible and gracefully degrade. Syndey is intended to be an application framework. Applications come with minimum system requirements, and Sydney's list includes "JavaScript is turned on".
Ian
Try Sydney then. The SourceForge page is a little out of date because I've been busy with school/work, but we've done a lot of work at Navtech recently (that's been the work bit of my excuse) to improve Sydney for the live web application we've built on top of it. It gives you combo boxes, tabbed windows, a table widget (a grid control would be an obvious extension to this) and a tree widget, amongst other things, and the Javascript's not crashy.
Other interesting features: cross-browser (works in Moz, IE, Safari, and (probably) Opera--no it doesn't work in Lynx, Emacs, etc.), keyboard support (you can navigate the tree and table widgets with the arrows, etc.), robust library code for managing data-presentation separation, custom context menus, unit test framework modelled after JUnit, and a source cruncher and a server-side include manager for speeding up downloads. I can't remember if any of these features are still only in the Navtech repository, but all the recents in-house improvements will be in the public repository before the end of April, maybe before the middle of April, depending on my final exam schedule.
Sydney works. We've built a complex web application on top of it that consists of more than 90,000 lines (3,000,000 characters) of Javascript (according to `find . -name *.js | xargs wc -l -c`) and several tens of thousand lines of Perl.
Ian -- Sydney maintainer