Name: Michel Alexandre Salim
Member since: 2002-10-29 01:20:58
Last Login: 2007-09-17 20:51:32
Homepage: http://hircus.wordpress.com/
Notes: I'm a Fedora contributor
Programming languages, in a nutshell
Task: List the programming languages you consider important or interesting. Describe each of them in one sentence.
| C | High-level assembler |
| Lua | Table-based, functional and embeddable |
| Python | Great RAD language crippled by dogma |
| Scala | Java done (almost) right, with Erlang- and Haskell-inspired features |
Posting this from the new N810 using its built-in keyboard. Typing those tags was painful, and as a result, more languages will be added to the table tomorrow — from the workstation.
Syndicated 2007-12-04 08:21:22 from Intuitionistically Uncertain » Technology
Why you should conditionally promise to buy the upcoming Nokia N810 tablet
So commercial software providers (Skype, Real Networks) will provide Linux ports if they judge that the userbase is big enough. Which is good news.
The same thing applies to Nokia itself, naturally, and sadly in this case, they do not think there is demand for Ogg Vorbis playback.
So if, like me, you find the product attractive, but have a personal collection of Ogg Vorbis files (or FLAC, which transcodes seamlessly to Vorbis), then this is what you can do:
All the software for the new device (minus GPS — though perhaps it’s the same software that comes with the GPS kit for N800? Oh, and the ambient light sensor) will run on the N800, so holding back won’t be that painful.
Syndicated 2007-10-18 03:57:22 from Intuitionistically Uncertain » Technology
Wide Finder: OCaml and JoCaml
Spent last night getting a crash course in using OCaml to do non-functional things (hash tables, file I/O, regular expressions) and the result is now up.
The JoCaml version does the file-partitioning trick used in the C++ implementation, with each finder workers being run inside a JoCaml channel; the channels share a single lock so they can update the hash table serially.
Interestingly, current implementation does not get a speed-up from the input file being cached (Ilmari’s wf.ml does). Will have to peruse his to see what’s slowing things down.
Lesson: not all techniques for processing a file line-wise are equally good!
Syndicated 2007-10-17 17:40:48 from Intuitionistically Uncertain » Technology
Wide Finder: C++ update
Talked with a colleague about the slow single-threaded performance of my Wide Finder implementation, and we narrowed it down to two possibilities:
First point can be ruled out: Boost compiles regular expressions when you assign them. Second point — well, reading in the file using std::getline turns out to consume the bulk of time.
I’ve reorganized the code a bit, using a multimap rather than a vector to rank the URLs by count, with no effect on speed. With two and four threads on a dual-core Intel notebook, the performance is at least on par with Ruby.
Alastair Rankine has a C++ implementation that is slightly faster, but uses Boost memory-mapped IO that I avoided for the same reason he put as caveat: that it will not scale to files that are too large. Which Tim’s log file might well be. Again, that is not significantly faster than the Ruby code.
Moral of the question: Perl and Ruby can be faster than C++! The C implementations out there are blindingly fast, but the way they do regular expression handling are really painful.
Will turn my (limited) spare time to doing a clean JoCaml implementation — it might not be faster but it definitely will look cleaner!
Syndicated 2007-10-16 21:15:21 from Intuitionistically Uncertain » Technology
JoCaml
After turning in the C/C++ monster (cleanest C code I reckon it is possible to write, thus the total lack of memory-mapped I/O and other optimizations), I turned my attention to picking a better implementation language.
Requirements:
As it turns out, JoCaml fits the bill perfectly. It’s an extension of Ocaml, so it combines a rich library with a familiar syntax (not to me, but having used both Scheme and Haskell, how different can it be) — and a very nice process calculus!
Example: this is a concurrent stack that blocks if there is no input available
let new_stack () =
def state (s) & push (v) = state (v::s) & reply to push
or state (x::s) & pop () = state s & reply x to pop in
spawn state([]);
pop, push
;;
This defines a private state channel, and then export the pop and push synchronous channels (that to the user behave just like ordinary functions)
and this is how you use it:
let pop, push = new_stack ();;
spawn echo(pop());;
push(1);;
Note that the echo channel will block, since pop can’t return a value until the stack contains something! This value is then pushed into the stack and ‘1′ printed.
More of this at the JoCaml site. And, as it turns out, there already is a JoCaml implementation of the Wide Finder, by Ilmari Heikkinen. Will have to grok the finer details from him.
salimma certified others as follows:
Others have certified salimma as follows:
[ Certification disabled because you're not logged in. ]
FOAF updates: Trust rankings are now exported, making the data available to other users and websites. An external FOAF URI has been added, allowing users to link to an additional FOAF file.
Keep up with the latest Advogato features by reading the Advogato status blog.
If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!