|
virang_21 wrote: If computer decide to restart itself is it sentient a world-class pain in the arse? Yes.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
Happens with Windows, not so much with Mac.
|
|
|
|
|
|
I'm making a little virtual machine to run backtracking regular expressions. It only has a few opcodes but it's all I need for matching.
enum Opcode
{
Nop = 0,
Char,
Range,
Match,
Jmp,
Split,
Any,
Save,
}
This is such a different approach than my non-backtracking expressions, which would basically be a subset of this machine with ... 2? instructions I think but it isn't implemented that way at all.
This is pretty cool. I can add regular expression features to the core runner by adding opcodes, but for the most part, I shouldn't need to add to these.
And they should be pretty easy to emit to either IL (as compiled) or C# (table driven) instructions
My instruction pointer is basically a List<Instruction> in tandem with an integer index. If I were doing it in C or C++ it would be an actual pointer, but I think a side effect of this is mine in some ways is a bit more efficient in that it doesn't need as many heap allocs as doing this in C in the most obvious way would, simply because of the way I've organized it.
I'm a long way from an article yet. I'm not even done with my machine compiler yet, but I'm still excited about it. This is cool stuff.
Steve Wozniak is the only thing at Apple that isn't evil.
|
|
|
|
|
Missing a few there.
honey the codewitch wrote: enum Opcode
{
Nop = 0,
Char,
Range,
Match,
Jmp,
Split,
Any,
Save,
}
enum {
EFileNotFound,
ECListCtrl,
EPizzaPineapple,
EVB6NotSupportedGoF(ault)Yourself
}
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
You're wasting your time because nobody but you understands regular expressions.
Now that Visual Studio has kowtowed to regular expressions, I find searching for non-trivial things to be a deep PitA. Its "help" on the topic just blows. Someday I'll make time to find decent documentation on the subject. Until then, I'm sometimes reduced to a two-pass approach, of finding too much and then searching for certain substrings within the results window.
|
|
|
|
|
Yeah but it's not just regex. It's the little machine that's cool.
For example, matching foo|bar
L0000: split L0001, L0005
L0001: char f
L0002: char o
L0003: char o
L0004: jmp L0008
L0005: char b
L0006: char a
L0007: char r
L0008: match
Real programmers use butterflies
|
|
|
|
|
Is it a coincidence you lot like to number your lines like basic-programmers?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
But isn't it past your bedtime?!
|
|
|
|
|
Tis, but not able to access my bedroom. Invalid password and such
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
I hope your wife didn't change the combination for the door lock.
|
|
|
|
|
It's actually necessary when dealing with naive assemblers or straight machine code as the language doesn't have labels, but it does have jmp instructions.
=)
Real programmers use butterflies
|
|
|
|
|
It's not necessary when sharing code, is it?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
It is because the labels in there refer to jump locations. If i didn't include them you wouldn't know where the split or jmp instructions landed.
Real programmers use butterflies
|
|
|
|
|
I actually scanned the regex articles that you posted and have to agree that it's a cool little machine.
I still have fond memories of PDP-10 assembler, in which jrst @. was a one-line infinite loop, roughly the equivalent of
sleep: goto sleep;
|
|
|
|
|
heh.
i like x86's xor ax,ax to set ax to zero. that was just silly, but popular back when everybody bit twiddled.
Real programmers use butterflies
|
|
|
|
|
The witch has discovered RegEx.
Brace yourselves, Guys.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
You're kind of late to the party, as I've been writing regex based lexer generators for years.
Real programmers use butterflies
|
|
|
|
|
|
In their all-knowingness, they determined that no one uses it so it is unnecessary.
On the other hand, was it just moved somewhere, possibly as a stand-alone program?
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
Rick York wrote: was it just moved somewhere, Sort of. You can debug t-sql in Visual Studio; however, it does not support conditional breakpoints.
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Deebugger? We don' need no steenkin' debugger!
You are getting too soft and pampered, that's the problem.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: You are getting too soft Hey, no fat jokes. How rude!
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
Well ... I didn't want to mention your avatar, which is getting a bit ... um ... possibly a few bytes too many?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
More 0s than 1s?
Social Media - A platform that makes it easier for the crazies to find each other.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|