alaricsp's comments

alaricsp | 16 years ago | on: The Prime Lexicon: A list of English words that are prime in base 36

I set my colleages a challenge: write porn using only prime words.

"WIDEST WOMB WOMAN WATCHED PET PERVERT WHIP BLINDFOLDED YIDDISH BITCH"

"BAREBACKED BARD RUTTED BLINDFOLDED BITCH"

"BAREBACKED BARD PULVERIZED TRUCKMAN RUTTED TORRID"

"YARDMAN WHIP UNUSED WHELP, TROLLOP SUSPECTED SILKEN RUNT. PUTOUT, PARTED, LAIN. EVALUATED FETISH,EXPENDED. DISINTEREST."

alaricsp | 16 years ago | on: WW2 "Simple Sabotage Field Manual" declassified [pdf]

Some highlights:

"Anyone can break up a showing of an enemy propaganda film by putting two or three dozen large moths in a paper bag. Take the bag to the movies with you, put it on the floor in an empty section of the theater as you go in and leave it open. The mothts will fly out and climb into the projector beam, so that the film will be obscured by fluttering shadows"

"When possible, refer all matters to committees, for further study and consideration. Attempt to make the committees as large as large as possible - never less than five"

"Cry and sob hysterically at every occasion, especially when confronted by government clerks"

alaricsp | 16 years ago | on: Ask HN: How to generate random terrain

That rogue-like cave generation algorithm isn't the kind of terrain I'm after, but is nonetheless quite awesome in its results. I'm now wondering if I can find an excuse to involve caverns in my game ;-)

alaricsp | 16 years ago | on: Ask HN: How to generate random terrain

I'd love to find the book again... I bet it's out of print, though. It had lots of detail on modelling damage to tanks, and creating terrain, and working out things like line-of-sight in complex worlds, and I think some basic AI, but had nothing to say about snazzy graphics whatsoever; I think it made some reference to vector displays or something like that ;-)

alaricsp | 16 years ago | on: Ask HN: How to generate random terrain

True, I glossed over my previous research; I didn't think it'd interest people, but you're right, it's wise to show some evidence of your previous attempts before asking for tips...

My googling always just found me more and more ways of generating the height-field data - it's the roads and so on that interest me. I tried tinkering with weighted random walks (eg, given the desire to continue a road from a given point, pick an adjoining cell with a weighting that prioritises having the same altitude and being closest to continuing the existing direction), but this fails to capture things like the fact that roads tend to run along valleys and mountain passes - the hard part, it seems, is in choosing initial points. Likewise, a river can be continued by finding the most downhill adjacent cell, until you find a minimum then starting a flood-fill algorithm to create a lake, until you reach a boundary pixel that "goes downhill", whereupon you can start a new river going down from there - but this fails to realistically account for the widths of rivers (you can just make the river wider as you go down, and sum the width of rivers that meet, but that simple model looks wrong: real rivers are deeper when in narrow canyons and the like).

alaricsp | 16 years ago | on: Why are networks so hard to build?

Perhaps I've just been unlucky ;-) This was Allied Telesyn kit IIRC.

But this is by the by! Rather than a damning indictment of STP, my real point was that having to configure all the layers of a network - physical cabling, VLANs, routing, firewalling - independently involves a load of effort that I'm not convinced is necessary. It'd be lovely to have routing functions occur in every switch, automatically routing between VLANs that are present together on the switch, and then doing MPLS-esque fast switching of frames across the network to destination switches if not - merging the switching and routing layers of the stack would just simplify things; why should we need the complex techniques we have to make networks resilient to failure?

alaricsp | 16 years ago | on: Why are networks so hard to build?

Sorry about the bad grammar :-)

Ok, the deal with STP and VLANs is thus: STP works at the level of the actual Ethernet cables in the system, rather than the VLANs.

Imagine you have four switches, A B C and D. Say vlan 1 exists on A and B; vlan 2 on C and D, and vlan 3 on all four, and physical cables (carrying tagged VLANs) run from A-B (vlans 1 and 3), A-C (just vlan 3), B-D (just vlan 3), and C-D (vlans 2 and 3); eg, they're in a square. And you enable STP.

STP will cause the switches (ignoring VLANs) to choose one of those four cables to disable, to remove the cycle in the network. It's as likely to disable the A-B or C-D cables, which will then split vlan 1 or 3 in half.

The solution is to make all VLANs present on all switches and (tagged) on all inter-switch trunks, so that any cable can be disabled and connectivity continues; there are extensions to STP that are aware of VLANs (such as the Cisco proprietary per-VLAN spanning tree); there's the recent (2003?) Multiple Spanning Tree Protocol (MSTP), but that's not supported by the switches I've been playing with, so useless to me at least :-)

alaricsp | 16 years ago | on: Making money from programming language design

This issue is dear to my heart, too, as a hobbyist programming language designer myself ;-)

I've never seen it as a route to income in itself - but it can do so indirectly. My project, ARGON (http://www.argon.org.uk/) is all about reinventing the platform we build software on - OS, programming language, libraries, file system, network protocol - purely because the current technologies we use are hampered by backward compatibility and poorly integrated; I think it'd be a good thing for the world to start again from scratch (and deal with compatibility at a higher level).

So I've thought more about how I might possibly make my hobby pay for itself. I think that an entire platform might well be successful as an embedded platform, as there's much less motivation for compatibility and a familiar programming environment in that market. In the workstation and server worlds, however, I think such a platform pretty much has to be open source, or it'll never be adopted by hackers who want something to play with. Then the usual open-source tricks will apply: selling boxed sets with manuals and 'enterprise tools' in, support contracts, commercial redistribution licenses, etc.

Getting rich by writing a book and general fame/glory leading to speaking engagements, however, is right out ;-)

alaricsp | 16 years ago | on: Bad programmer seeks advice

The best introduction to real computer science that I know is the book "Structure and Interpretation of Computer Programs". It teaches programming in terms of Lisp, but don't be put off - it's just because Lisp is a good vehicle for exploring different approaches. The lessons therein have stuck with me no matter what language I'm using.

Beyond that sort of thing, you need to specialise in the kind of areas you want to work in - if you want to program to earn money, then learning SQL, HTML, and web app development in your favourite platform is a good idea. If you go for the Unix route, I'd recommend you learn Python before Perl/PHP, but then learn the latter two because there's money in it. If you go the Microsoft route, I'm sure there's plenty of good books on C# and ASP.net. Java's pretty useful, too.

It's a good idea to learn C, not so much to learn the language itself as to learn about the processor's memory model, which C somewhat ruthlessly exposes you to; if you master C, you'll indirectly learn how software performance works, in ways that'll indirectly help you write faster code in higher-level languages. And, of course, C is useful in its own right if you want to get into embedded, systems, or games programming.

Personally, I think C++ isn't a good language to get involved in; if you want to anyway, either because you disagree with me or because you're after a job doing C++, make sure you've read Structure and Interpretation of Computer Programs, played with C, and tried at least one object-oriented language first; C++ is complex, and having a strong background in the basics behind it will help you a lot; trying to dive straight in might lead to a rather painful learning experience.

Perhaps most importantly, find a programming project you are excited about, and do it. When you're done, you'll have realised you'll have made lots of mistakes - but you'll never make those mistakes again, and the next project you do (perhaps one you'll be paid for) will be a lot better. Practice makes perfect! And have fun!

alaricsp | 16 years ago | on: Why C++ is not my favourite language

That is indeed a most potent collection of detailed arguments!

Now, let's just wait for my colleague to start ribbing me for keeping our project written in C again... ;-)

alaricsp | 16 years ago | on: A design pattern is an artifact of a missing feature in your chosen language

I think it's a knee-jerk reaction to how the more zealotous members of the design patterns community have had knee-jerk reactions to people questioning the scripture status of the Design Patterns book.

Once a bunch of people get religious, another bunch of people will crop up to get religious against them in turn.

I think design patterns are useful and valid; but I think they should be evaluated individually within the context of a given programming language, not necessarily considered global.

alaricsp | 16 years ago | on: Why C++ is not my favourite language

Yes... sort of.

SRFI-4 (http://srfi.schemers.org/srfi-4/srfi-4.html) provides a standard interface for dealing with 'homogenous vectors' (eg, arrays of unboxed integers or floats), which is great for shuffling bytes.

For bits, there's the usual bitwise-or and all that.

However, both could be improved somewhat; what the Factor folks have done with their struct arrays is IMHO superier.

alaricsp | 16 years ago | on: Why C++ is not my favourite language

Yeah! Synthesis is quite excellent. I've been interested in exploring using the FORTH model of easily-accessible-runtime-compiler in that sort of context...

alaricsp | 16 years ago | on: Why C++ is not my favourite language

I've not seen anything like the dynamic-dispatch optimisations the Self team came up with in the 1990s done in C++, nor problem-domain optimisations expressed as macros as is often done in Lisps, nor the aggressive constant-propagation of closures and their eventual inlining that Factor does.

Perhaps some of them could be applied, but a highly complicated base language with extensive mutation semantics (including pointer aliasing) probably mean they'll be so limited in their applicable scope, and so difficult to implement, that it's not an attractive activity for C++ compiler writers...

page 1