|
Jörgen Andersson wrote: Is NJ anywhere close to Broomfield, CO? If you zoom out far enough they are yay distance apart.
|
|
|
|
|
NJ (New Jersey) is northeast USA; it touches New York City.
CO Colorado is almost center of USA.
|
|
|
|
|
Did you update your hosts file?
Start here[^].
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Thank you for the info about the site, I didn't know that - I used a third party software for that.
GCS d--(d-) s-/++ a C++++ U+++ P- L+@ E-- W++ N+ o+ K- w+++ O? M-- V? PS+ PE- Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++* Weapons extension: ma- k++ F+2 X
|
|
|
|
|
Okay, so "code synthesis" (what I've heard it called in newsgroups and such but i don't know if there's an official term) is the process of generating code that - to put it simply - looks more like code a human would write than code that is generated.
For example:
if(ch == '\"') {
ch = _FetchNextInput(cursor);
if(ch == -1)
return false;
goto q1;
}
return false;
q1:
if((ch >= '\0' && ch <= '!') || (ch >= '#' && ch <= '[') || (ch >= ']' && ch <= 1114111)) {
ch = _FetchNextInput(cursor);
if(ch == -1)
return false;
goto q1;
}
if(ch == '\"') {
ch = _FetchNextInput(cursor);
if(ch == -1)
return true;
goto q2;
}
if(ch == '\\') {
ch = _FetchNextInput(cursor);
if(ch == -1)
return false;
goto q3;
}
return false;
q2:
return false;
q3:
if((ch >= '\0' && ch <= '!') || (ch >= '#' && ch <= '[') || (ch >= ']' && ch <= 1114111)) {
ch = _FetchNextInput(cursor);
if(ch == -1)
return false;
goto q1;
}
...
return false;
...
Forgive me for the long example, but I couldn't think of a shorter one that I had on hand that would serve. It's not the complete code, but you can see it's generated goto tables, and if you squint you can see they match text.
Humans wouldn't have written code like this - at least not typically, and without enough caffiene.
Anyway, check out just under q1:
q1:
if((ch >= '\0' && ch <= '!') || (ch >= '#' && ch <= '[') || (ch >= ']' && ch <= 1114111)) {
ch = _FetchNextInput(cursor);
if(ch == -1)
return false;
goto q1;
}
that could be
q1:
while((ch >= '\0' && ch <= '!') || (ch >= '#' && ch <= '[') || (ch >= ']' && ch <= 1114111)) {
ch = _FetchNextInput(cursor);
if(ch == -1)
return false;
}
...
And then I find other opportunities to "collapse" code by similarly examining the flow (which i already have state diagrams for in this case, but in the general case you'd build some sort of flow diagram over your generated bits like that and work with it), and then i do it over and over again until there are no more changes to the code/flow
This could yield some pretty cool results. It's nowhere near an article yet. Just an idea I had this morning while working on an update to Reggie.
Real programmers use butterflies
|
|
|
|
|
People can't be trusted to write good code; I prefer computer-generated code.
|
|
|
|
|
I know you're joking, but I agree with that sentiment. Less bugs. Code to a spec. The problem is the code is not "pretty" - this is to make it "pretty" so that once the tool no longer functions anymore the code is hand editable. =) it's next-level codegen.
Real programmers use butterflies
|
|
|
|
|
Wouldn't someone simply pull it into VS and reformat it as desired?
|
|
|
|
|
Yes, if the idea is only to have the tool help you draft the code.
No, if the idea is to evolve the code using the tool.
|
|
|
|
|
It's not about formatting, so much as it is about eliminating things like goto tables, and resynthesizing state machines into something a little more organic where possible.
Real programmers use butterflies
|
|
|
|
|
honey the codewitch wrote: Less bugs
Wouldn't that depend on who wrote the code generator?
|
|
|
|
|
It's a math problem though. If I generate code N times, 1 bug is replicated N times. If I fix the bug in 1 place, that's N less bugs.
But yes, the code should be correct. However, built correctly once, it writes correctly every time.
Real programmers use butterflies
|
|
|
|
|
Could be worse, could be O(N2)
|
|
|
|
|
One (human) generation ago, HLL compilers were introduced so that programmers wouldn't make errors confusing, say, left shift with rotational shift. Lots of coding errors were avoided.
So we moved bug creation to a higher level, such as off-by-one-errors and referencing undefined elements. Bugs became more sophisticated.
Code generation brings bug sophistication to a new and higher level. In the old days we were working with people who had a deep understanding of the problem solution. As we learned to handle that, we gradually start communicating with people who knows little beyond 'When I press this key, that happens!' So, the bugs are no longer at the level of plain vs. rotational shift, but in fundamental flaws in how to solve the problem. No one of the problem domain experts is there to oversee that we code the solution according to their professional understanding of the solution. That isn't necessary, now that no coding is required.
Or, that is what we believe. I think we need a new coding-less profession: A kind of professionals with no coding experience, who don't give as d**n about safe pointers and code templates and indentation rules, but are experts in analyzing user problems, work patterns, interaction and dependencies between different information structures. People who are professionals in defining tasks for us IT guys to solve according to the needs of the users, without being steered / dictated / limited by specific coding methodologies.
Long, long time ago I read an introduction to COBOL-60, proclaiming that the language would wipe out the need for computer programmers; now the users themselves could specify the handling of the data in this language very close to natural English language. The 60+ years since COBOL-60 was released has certainly shown us that problem is not in knowing the programming language keywords, but far more in a thorough problem analysis and understanding. That remains, whether we call the tools 'compilers' or 'code generators'.
To be honest: I cannot clearly tell the dividing line between a 'compiler' and a 'code generator'. That is doubly true if you claim that 'code generators' is something that has appeared the last 20 years or so, that earlier systems were not 'code generators'. To me, this is a lot like reinventing wool.
|
|
|
|
|
I'm afraid I can't let you do that, Dave
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Hello David, Shall we play a game?
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
I'm afraid you gonna realize soon how simple a human brain is
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
My SO is hard pressed to throw away something that she thinks she'll be able to use later.
Last night she was cleaning up her computer area, rounding up software she'll need for a fresh install and brought me a disk and asked if it was any good. Windows 95
I don't have a floppy or I would throw it on a VM just for kicks so I gave it back to her and she put it back on the shelf.
The less you need, the more you have.
Even a blind squirrel gets a nut...occasionally.
JaxCoder.com
|
|
|
|
|
Quote: My SO is hard pressed to throw away something that she thinks she'll be able to use later. Count your blessings. It's the reason you're still around!
|
|
|
|
|
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Someone was asking about an FDD adapter a while back...
|
|
|
|
|
A disk, as in, a floppy?
The 95 installer was available on a set of 21 floppies. If you just have one, it's gotta be something like just a repair disk and nothing else. Not useful.
And as far as I know, 95 won't run under Hyper-V (at least that was the case in the few first versions, then I gave up trying), so if you want it on a VM, you'll have to use something like VMware or VirtualBox.
|
|
|
|
|
dandy72 wrote: The 95 installer was available on a set of 21 floppies. If you just have one, it's gotta be something like just a repair disk and nothing else. Not useful.
Yeah you're probably right.
dandy72 wrote: something like VMware or VirtualBox
I use VirtualBox
The less you need, the more you have.
Even a blind squirrel gets a nut...occasionally.
JaxCoder.com
|
|
|
|
|
Win95 was available on a CD-ROM as well.
When I replaced my old PC with a floppy-less one, I bought an external USB floppy drive. It won't read all my old 5.25" real floppies (the 3.5" ones in a stiff plastic shell won't flop at all!) - but one problem is that since Windows XP, the driver insists on finding a format code in the boot sector indicating whether this is a 360K, 720K, 1.44M or 2.88M disk.
I guess that all official Windows releases were written to floppies with a proper format code, but several of the major blank floppy vendors sold 'preformatted' disks, which had the proper sector layout written to the disk, but without writing the format code to the boot sector. DOS and earlier Windows versions then tried reading the disk, assuming one format after the other, until it came upon one that worked. With XP, MS said 'This is silly - if there is no format code, we are not going out on a hunt, but treat the disk the way it claims to be: Unformatted!
So your major reason for keeping a pre-XP machine alive is to read old floppies that you bought as 'preformatted' but without the proper format code in the boot sector. There might possibly be some 3rd party USB floppy driver out there that can read those half-formatted floppies, even under Win 10, but I never heard of any. (If you can point me to one, I will ditch my old Win95 machine tomorrow!)
|
|
|
|
|
Visual Basic 4. It came on 6 floppies. With a read error on disc 5
One of the best buys ever.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|