|
Sounds...inefficient. In an "abusive" sort of way.
|
|
|
|
|
Oh it is. This is what math and computer science doctorate holders with a masochistic streak do to unwind.
It's part of a LALR(1) parser table generation algorithm.
The whole thing is abusive. I feel like I'm gaslighting my CPU whenever I run it, because the damn thing doesn't make any sense and shouldn't work, but it does - expertly.
It is literally the most convoluted, ridiculous and monstrous thing I have ever implemented aside from pure hacks.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
And you've been writing articles about it. Are you saying you're writing these so they serve as warnings to others?
|
|
|
|
|
If you're smart, that's how you'll take them. Get too interested and you'll turn into a parsing gollum like me.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
honey the codewitch wrote: If you're smart, that's how you'll take them.
Genuine LOL.
|
|
|
|
|
ugh, i've covered so much of the Pck project and I've barely even touched the API which is Microsoft big.
It has 4 different document object models in it - with two different kinds of expression trees
It has 2 different parser generators and a lexer generator in it.
It also has transformations to other grammar formats.
And the entire process, from building the grammar to generating the code can be done using the API.
Plus there are runtime parsers.
It's ridiculous. this is huge. i need like, 5 dedicated devs on this.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
|
The DOMs *are* the facade. You should see what they cover up!
Actually the API is easy to use. It's just big.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
honey the codewitch wrote: Actually the API is easy to use. It's just big.
I haven't had a chance to really dive into the project but I was thinking of writing some adapters so this project could be used in one of my parser-oriented projects once I get it finished. So that's good to hear!
|
|
|
|
|
Hit me up if you have questions. I check back at the article periodically but i don't get notified when there are new comments there. The best place to find me is in the lounge, tbh
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
var lex = LexDocument.ReadFrom(filename);
var cfg = CfgDocument.ReadFrom(filename);
var tokenizer = lex.ToTokenizer(cfg.FillSymbols());
var parser = cfg.ToLalr1Parser(tokenizer);
that's not that bad for creating a LALR parser and tokenizer from a PCK spec at runtime
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
I've used a dictionary keyed by dictionaries once.
I had to take a shower afterwards.
How's that on a scale?
|
|
|
|
|
that's pretty good. Conceptually i view dictionaries as indexed groups most of the time. In fact, half the time i use dictionaries they have a collection as the TValue member, never mind the key, so they're a fancy collection with an index affixed to it that i use for grouping. In SQL a dictionary is a GROUP BY call.
So I can definitely see using one as a key.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
Hmm. I use this:
Dictionary<Token,Dictionary<Token,Value>> a lot. Now that I look at it, yours is a lot more perverse.
Software Zen: delete this;
|
|
|
|
|
but where's your LALR(1) parse table?
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
This is the last post I read from you. The fact that you use words or alogrithms that I do not understand plus the fact that they seem so evident to you makes me feel real dumb.
|
|
|
|
|
You think they're evident to me LOL. I understand them about as well as you do. The trick is to practice the ability to code things you don't understand. That way you don't have to be smart.
Duh.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
I only code things I understand, that's why I stopped coding ten years ago . Today, too much patterns, too much languages, too much frameworks, too much resources. It is less fun - and yes, I am starting to talk like an old fart.
|
|
|
|
|
When I got old and crotchety i stopped using other people's code in my apps *except in UIs*
If I need some big functionality, like drawing graphs of state machines, I'll use a 3rd party tool like Graphviz from my code, but I run the damned executables and capture input and output rather than trying to integrate their API directly.
I don't like other people's code, and I know other people don't like mine.
I like what other people's code *does* sometimes. So if i use it, it's usually behind a "firewall" of being a totally separate app automated by my code.
None of this is professionally practical of course. I'm out of the field though so I can do what i like!
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
I told my boss I quit last week, so in one or two weeks I'll be officially out of a job.
I was planning on building my own business, which I've done part time for the past year.
I'm trying to get some projects and customers and so far I've been doing pretty well, sort of by accident because some clients came to me.
And if that doesn't work out I was thinking of going freelance (and possibly have both).
But now I've got a really interesting offer to work for an employer again.
The company is interested in meeting me and I'm certainly going to give them a call.
So then the question arises...
Do I want to build a business and/or go freelance or do I want to be employed?
Both have pros and cons and I'm really not so sure what I want
|
|
|
|
|
Employment: you have a lot of idle time and/or boredom and a guaranteed regular paycheck.
Freelance: you have a lot of idle time looking for work and panicking about the next payday.
Going into business yourself: You have absolutely no idle time (or life for that matter) and are constantly panicking about the next payday.
|
|
|
|
|
Employment: Steady income.
Freelance: Less steady, but much higher income.
Going into business yourself: Possibly no income at all, but also the only possibility to become filthy rich while others do the work for you
As I said, pros and cons to all
One of the pros that makes me seriously consider the employment job is the ability to learn from coworkers and grow into a multinational company.
|
|
|
|
|
Marc Clifton wrote: Employment: you have a lot of idle time and/or boredom and a guaranteed regular paycheck. Something I just learned, I've been unemployed my whole life.
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.
|
|
|
|
|
having a business can be rewarding but there are so many hidden costs and so much hidden labor it's a huge risk even before taking into account a flighty clientbase.
You also have to be salesperson, dev, accountant, PR point and somehow find time for all that while doing QA as well.
Or you can hire, which means regulations, SS payouts, etc.
Subcontracting is a bit easier in that case.
But I don't know. If you've been doing it for awhile and have the inertia then maybe run with it. The sky is the limit, unlike working for someone else.
On the other hand, a little security is nice. And not having to manage all the details.
When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.
|
|
|
|
|
honey the codewitch wrote: You also have to be salesperson, dev, accountant, PR point and somehow find time for all that while doing QA as well.
This.
IMNSHO, if you love to code and want to code for a living, go work for somebody else. If you don't mind spending the majority of your time doing things other than coding (because don't kid yourself, this is what you're going to end up doing), then go ahead and be self-employed.
Personally I've always worked for others for this very reason.
|
|
|
|