The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.
1. The lounge is for the CodeProject community to discuss things of interest to the community, and as a place for the whole community to participate. It is, first and foremost, a respectful meeting and discussion area for those wishing to discuss the life of a Software developer.
The #1 rule is: Be respectful of others, of the site, and of the community as a whole.
2. Technical discussions are welcome, but if you need specific programming question answered please use Quick Answers[^], or to discussion your programming problem in depth use the programming forums[^]. We encourage technical discussion, but this is a general discussion forum, not a programming Q&A forum. Posts will be moved or deleted if they fit better elsewhere.
4. No politics (including enviro-politics[^]), no sex, no religion. This is a community for software development. There are plenty of other sites that are far more appropriate for these discussions.
5. Nothing Not Safe For Work, nothing you would not want your wife/husband, your girlfriend/boyfriend, your mother or your kid sister seeing on your screen.
6. Any personal attacks, any spam, any advertising, any trolling, or any abuse of the rules will result in your account being removed.
7. Not everyone's first language is English. Be understanding.
Please respect the community and respect each other. We are of many cultures so remember that. Don't assume others understand you are joking, don't belittle anyone for taking offense or being thin skinned.
We are a community for software developers. Leave the egos at the door.
Or, is it a coded guide to different types of programmers ?
From Lucy Cooke's description of tropical latitude penguins in "The Truth About Animals" [^] :
These birds have evolved creative strategies to avoid getting overcooked. Some species stand around panting like dogs, others are forced to seek out shade. Yellow-eyed penguins trek over half a mile inland (quite a marathon for those little legs) to raise their chicks in the cool of the New Zealand rainforest. Galápagos penguins avoid the brutal equatorial sun by nesting in uncomfortable-looking cracks of coastal lava rock. Humboldt penguins arguably have it even worse. Living on the barren coast of Peru they are forced to improvise shade by carving castles of crap from piles of their own mature manure. Fairy penguins solved the problem by shunning the sun altogether and becoming nocturnal.
I have to admit that "improvise shade by carving castles of crap from piles of their own mature manure" reminded me of someone here, but, I decided not to mention that for fear of raising the temperature of any current brooders
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
So optimizing my lexer machine is slow going, but i'm feeling clever.
Introducing a new switch/case instruction worked, cutting the lexing time for the DFA version of my simple test lexer to as little as half what the NFA version costs
NFA lex: fubar bar 123 1foo bar -243 0
Lexed in 0.0217 msec
DFA lex: fubar bar 123 1foo bar -243 0
Lexed in 0.0134 msec
The trouble i'm having is
A) loading lazy quantified regexs into the NFA graph. I don't know how to represent them
B) Doing a partial, opportunistic transformation from NFA to DFA. I am running into trouble due to my use of a rangeset as my basic input alphabet element among other things.
Once I can do that though, I'll have significantly optimized this little machine. And I'll have what will be pretty close to a "real" optimizing compiler for it.
jmp id, int, space, error
id: ; [A-Z_a-z][0-9A-Z_a-z]*
set "A".."Z", "_", "a".."z"
id_loop: jmp id_part, id_done
id_part: set "0".."9", "A".."Z", "_", "a".."z"
id_done: save 1
int: ; (0|\-?[1-9][0-9]*)
jmp int_zero, int_nonzero
int_nonzero: jmp int_neg, int_pos
int_neg: char "-"
int_pos: set "1".."9"
jmp int_part, int_done
int_part: set "0".."9"
int_done: save 1
space: ; (\t|\n|\v|\f|\r| )
set "\t", "\n", "\v", "\f", "\r", " "
error: ; anything not caught above returns -1
switch case "A".."Z","_","a".."z":id_part, case "0":int_done,case "-":int_neg,case "1".."9":int_digits,case "\t", "\n", "\v", "\f", "\r", " ":space,default:error
switch case "0".."9","A".."Z","_","a".."z":id_part, default:id_done
switch case "0".."9":int_digits, default:int_done