Ask Slashdot: What Should Be the Attributes of an Ideal Programming Language If Computers Were Infinitely Fast?
An anonymous reader writes: Earlier today, Tim Sweeney, the founder of Epic Games, asked his Twitter followers an interesting question: "What are the attributes of an ideal programming language if computers were infinitely fast, and we designed for coding productivity only?" I could think of several things, the chief of which would be getting rid of the garbage collection. I was wondering what other things you folks would suggest?
This is stupid. Computer will never be "infinitely fast" or even close to it. There is always the possibility of ding computation in such a way as to drag down any system.
There is always a compromise between programmer productivity, code maintainability, and system performance. It's not like you can realistically escape this triad so why pretend one leg does not exist? The computer programming industry has enough problems with magical thinking as it is.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
Tell the computer what you want and it will compute it in zero time.
If computers were infinitely fast, there wouldn't be any reason to change any programming languages since infinitely fast means you can do whatever you want and not have to worry about it.
...and infinitely fast computer would be self aware and wouldn't need instructions.
When Fascism comes to America, it will call itself Anti-Fascism, and tell you to give up your guns.
...
LISP
And GOTO, no GOSUB though, that's dumb
The language for an infinitely fast computer is called DUH.
There are no keywords, operators, or logic structures; the entirety of the language is you typing "DUH" into the command line, then hitting ENTER.
Upon pressing ENTER, you are presented with every possible program that could ever exist. All you need to do is select the one you want.
Obliteracy: Words with explosions
You'd be able to create your own private universe. So I'd program by using the properties of physics.
CAST IN THE NAME OF GOD
YE NOT GUILTY
etc.
once you hit 88 mph, it creates a really weird paradox
Getting rid of garbage collection? The feature whose whole point is boosting productivity at the cost of performance? In a setting where performance is explicitly not and productivity explicitly is? Can you spell "hangup"?
sudo ergo sum
In that case automatic verification of the halting problem for the code during compilation.
Or did you just mean "very fast"?
getting rid of the garbage collection
Why would that be the chief thing to drop if you had infinite performance? The only big problem with garbage collection IS performance.
Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
It should be a highly parallel language, where you can program with constraints.
Would take no time and its nice not worrying about garbage. Doesn't say infinite memory...
There is no garbage collector in C, so it must be the ideal programming language ;-)
Special mention for assembly too.
"Science will win because it works." - Stephen Hawking
It should be capable of understanding normal language, any known language, and execute the idea of what you asked for... But do so with disastrous unconsidered consequences. Man should not toy with technology!
This sig intentionally left blank.
I'd like to be able to type "i didn't explain that well but you know what i mean" and have that compile to the correct logic.
I came to the datacenter drunk with a fake ID, don't you want to be just like me?
An ideal programming language would support powerful features like the following statement:
print("Does P == NP?", P == NP ? "Yes." : "No.")
I just imagine a world of cross-joins, extremely complicated in-string, lazy iteration and the like.
If there were no penalty for pivoting data or iterating though sets, we would all gravitate toward the shittiest constructs imaginable...
I mean hell, browsers are basically expected to be limitless now... HTML hello world used to look like "Hello World" Now it looks like
"Hey javascript framework, load 500 modules, then ask the server what "Hello" is, then ask the server what "world" is, then style it all in whatever your 13 generated CSS files say it should be styled as, and tell google analytics that someone looked at my hello world page."
When computers become "infinitely fast", having them "Do what I mean" vs "Do what I say" will be the singular distinguishing capability that will finally make the contraptions useful to every day humans.
English... including the command "you know what I meant" to easily get rid of bugs. Great question... or... something.
Wouldn't an infinitely fast computer be completely useless in that doing anything with it would result in a race condition?
Obliteracy: Words with explosions
They don't have to be infinitely fast. They need to be infinitely deterministic. Ie. a measurement or an interrupt must arrive in time, with in-time defined by the maximum timing boundaries of the experiment being executed.
If that happens with a garbage-collector (which is now infinitely fast), then we could perhaps use higher languages for real time.
Obviously if performance no longer matters at all, all function parameters, both in and out, could be checked. Sure why not, then.
And how about having infinite memory and storage resources at equally infinite reading and writing speed?
However, rfc1925:
(2) No matter how hard you push and no matter what the priority,
you can't increase the speed of light.
"Imagine you/we had no boundaries whatsoever" is generally *not* a good way to induce bursts of creativity. It's like creating a game where there are no rules.
An infinitely fast computer should be able to interpret my programming abstractions based off of zero lines of code.
1) The language would be graphical, not English based. Not everyone speaks English and all languages, including English have in built issues. You want a loop, drag and drop (or use control keys to instantly create) a loop icon, don't type it. With speed not an issue, go for the fancy graphics.
2) The language would be interpreted, not compiled - infinite speed so no problem.
3) The language would be object oriented
4) The language would have no declarations or variable types (infinite speed so these things do not matter as much).
excitingthingstodo.blogspot.com
Being able to detect if any inputs would cause a hang/endless loop. As your program could be expressed as a BB(programLength), meaning that infinite loops would be detectable. (BusyBbeaver function)
Memory leaks could be found quickly, by trying all possible inputs infinite times, in each possible order.
Full Asserts could be checked
Checking for side effects.. Run chunks of code side by side, and see if the states change depending on the side code.
Building custom compression... Build a self extracting executable, with the absolute minimum amount of bytes possible.
Auto-recoding.. Have the system automatically recode the program into an exact specification (for review by human), and then re-compile based on spec (ultimate code optimizer)
Knapsack, TSP, Brute_force_decrypt would be standard libraries.
... "register" and "inline" - to make it even faster than infinitely.
It must have been something you assimilated. . . .
If computers were infinitely fast, things would be way too different to predict accurately:
- there would be no encryption, hence no online banking/shopping or anything else that required a secure connection
- computer graphics would be almost instantly indistinguishable from real life objects
- neural networks, quantum computers, non-polynominal algorithms would all be viable
And thus, all programming languages would become obsolete since neural nets simulating human level intelligence could be created - thus we'd have star trek TNG style interaction with computers or better. The entire software industry would be instantly over.
Oh - so you meant not infinitely fast after all? Well, it's still a dumb question. As computers get faster, new ways of utilizing that power will emerge to do things that are not possible today. Gone will be things like 2D video, and we'll get 3D holography instead. After 3D holography, who knows - probably encodings that allow for touch/taste/smell and more (after that, who knows - probably way to encode an object itself for replication). The more speed/bandwidth we get, the more we'll use, and we'll continue to whine that we don't have quite enough for the latest cutting edge stuff. Hence fast programming languages will always be needed for those applications (while the 50Gb UIs will be ever more created by people saying that "speed doesn't matter").
Need to be built as carefully as real experiments. This isn't one. If the computer is infinitely fast then the computer language can be structured to process non ambiguous natural language, we don't need computer languages, just people trained to be unambiguous.
That is totally ignoring the fact that our society runs on the premise that computation is expensive, and an infinitely fast computer would destroy all concepts of security based on expensive computation, and society would collapse and there would be no companies left to build these infintitely fast computers.
I am sorry, I don't know Tim Sweeney, but that question brings up one of my own. How have we as a technical society managed to produce people with the implied logical skills that programming requires (and his wikipedia bio does indicate he is a competent programmer, even a good innovative one)
but who can't think a simple fallacious question through before tweeting it, or at least can't communicate the real question he wants to ask behind this ridiculous tweet? This is really a very fundamental logic flaw here. it is the equivalent of asking "if price were no object..." Given any infinite resource just do it how ever you want, it's not like you are going to run out.
"Proximity to wonder has blunted our perception and appreciation of it" --Tim Hartnell in 'Exploring ARTIFICIAL INTELLI
Computers with that much processing and computational power should be able to handle every programming task with natural language. I should be able to ask for a task to be completed without requiring me to program it in some other language.
Simply ask the computer to do every task. No HMI required other than voice command.
Multithreading ruins otherwise sane applications. Multithreading exists solely for performance but correct multithreading code is a disaster to write and maintain (even with libraries managing the nitty-gritty details). Being able to run all network and database operations on the UI thread on Android, for example, would result in far less hurt and fewer application crashes.
Crash infinitely faster.
The problem with GC is that it causes your program to pause at inconvenient times. If computers are infinitely fast, there's no reason not to have garbage collection!
The alternatives are:
1. Manual allocation/deallocation: this is what C uses, is incredibly error-prone, and distracts from the programming task at hand. GC (bookkeeping) is amortized over malloc/free calls.
2. Reference counting: this is what modern C++ uses with its various smart pointers, but choosing a type of smart pointer distracts from programming and circular references require special handling (weak references or GC). GC is amortized over malloc/free calls, and may still need to pause the program to clean up circular references.
3. No dynamic allocation: this is what memory-constrained systems (like many embedded systems) do, but is not useful for general-purpose programs.
4. Everything is a leak: if you have infinite memory you can just keep allocating forever and never free anything. However, this is unrealistic, and may not be desirable anyway if you want GC to clean up things like open files or event handlers with weak references to objects that are no longer needed.
In other words, GC like Java or .NET have is really the ideal feature -- except that it sometimes slows down your program, and that's solved by making the computer infinitely fast.
dom
It should be able to understand and do whatever comes after "I want you to..." both as a vocal or written statement.
I would create a counter to count from 0 to infinity, and point the CPU IP do the address of that big integer. The program I want will be generated somewhere along the way. The trick is to filter out the ones you don't want.
I'm going to continue using the Host File Engine. Your software is well written, functional. The Host File Engine performs exactly as promised by mmell
his hosts program is actually pretty good by xenotransplant
his hosts tool is actually useful for those cases in which one does indeed want to locally block stuff outright while consuming minimum system resources by alexgieg
I've never tried to belittle (APK's) work, I've flat out said it's good by BronsCon
take a look at the APK hosts file engine by SuperKendall
APK is kinda right. I've tried his hosts file generating software. It works by bmo
I like your host file system by Karmashock
I find your hosts file admirable by vel-ex-tech
* My code's liked + recommended & hosted by Malwarebytes' hpHosts!
APK
P.S.=> Delphi 32/64-bit (no null-terminated string buffer overflows like C/C++) single .exe multithreaded "Hyper-Alloy combat chassis" virusproof uncrashable code design gets you THOSE kinds of reviews above... apk
Your program would therefore be done before you'd written it. You can then say, "what a dumb-ass I will have had been." I'll just rewrite it. Oh, I will have did? That's looking pretty good. Let's just...
The quote means "getting rid of having to worry about manually collecting garbage" (destructors, etc). Presumably the infinitely fast computers would handle all of these details in the background and the human interaction would be abstracted away from the computer towards more naturally-human ways of thinking.
Decided to wait ten minutes for the guaranteed litany of responses concerning garbage collection and how its removal would be the LAST thing you'd want to do..
Seems to me this hypothetical language is the one in which Elon Musk's universe is written. ;)
I guess he never heard of Wirth's Law. Compared to 20 years ago, our computers are operating at and infinite speed with ridiculous amounts of RAM. Yet the desktop, IDEs, and applications seem slower than they were 20 years ago, require Gigabytes(!!!) of RAM, and do not seem to do anything more than they did before. Go figure.
With an infinitely fast computer all permutations of the code would be tried and all of the answers presented. Statistically all of the answers would be compared and the most likely answer displayed.
Alternatively the user could then just select out the correct answer from the infinite number of incorrect ones and therefore solve any problem.
Of course the power bill for the computer would be high!!
Expanding on the question..
What if there is infinite storage?
There would be no need for a infinitely fast computer.
A direct link to a human brain. I wouldn't use Windows though, you might shit your panties when it BSODs.
I imagine if a computer was infinitely fast, it would be able to execute the program's core loop an infinite number of times in an instant. It follows then that it would instantly reach the inevitable point where it encounters a fatal error.
return would be the only keyword, and 0 the only allowed value.
With such a small language coding productivity would be remarkable. As a side bonus, the entire lexer and parser would fit in a small FSM. Actually, screw that, just take *any* input and return object code equivalent to "return 0" - we can remove syntaxical and syntactical errors without the need for testing, thus increasing QA productivity.
Functionally speaking the language would be useless, but developers could be incredibly productive at writing that code. The question is a classic example of Garbage in, garbage out.
OK, playing along a little bit. For coding productivity you'd want developers to never need to worry about memory usage, mallocs, swap, disk etc. Just let them worry about using data elements as they see fit and make the system handle storage and permanence. I don't see how you do that without garbage collection techniques.
The language contains a single function, that takes anything as input.
This information is then converted to a single opcode that is executed on the computer.
Documentation: :: Do What I Mean
DWIM
Output := DWIM([any])
Converts, computes, or calculates the user's desired output given any input.
Example 1:
Arthur Dent executes the program:
Foo:=DWIM("Potted Petunia")
Foo now contains a perfectly brewed cup of tea in a fine bone-china cup with matching gold rimmed saucer.
Fully check input prior to executing. A null string will cause the universe to cease to exist.
Aside - Stupidity of this ranks up there with Superman vs. Thor, or similar kindergarten-esq "My Ghod can beat up / more powerful than your Ghod stuff."
Fred in IT
What a pedantic bunch. Mental race conditions because of the word 'infinitely'. Anyway, let's ask this question a different way. "If modern hardware had been available at the time, how would you have designed languages like C, C++ and JAVA? What compromises were made that continue to impact those languages?"
and the fact that anything still takes perceptible time tells me that even if computers had gamma ray clock rates, you programmer asswipes would still find a way to gobble up every single cycle doing god-knows-what-except-what-I-want.
If it's infinitely fast, and I don't have to maintain the code, why not?
---- The above post was generated by the Turing Institute. Maybe.
Never upgrade the hardware to run Windows ever again — I'll probably be out of the job as an IT tech.
library includes (why load separate libraries when the system is able to have all of them available?)
I can think of reasons.
The first is namespacing. A program needs to identify that it wants to use a particular library or security updates thereto, as opposed to a similarly named library without the needed functionality.
The second is copyright. A computer program is thought to be a derivative work of the libraries that it is explicitly designed to load.
The third is bandwidth. Even if computers are infinitely fast, radio frequency bandwidth isn't. It costs money to launch a satellite or build a tower, money that must be recouped from subscribers who may not be willing to pay for a large enough monthly data transfer quota to allow continuous retrieval of every library under the sun.
How about a natural language processing neural network compiler that converts human speech into a formal system of program requirements, then synthesizes an optimal program that fulfills said requirements? We already have software that does all the various parts of this, so all we have to do is figure out the infinite speed part.
But if you didn't have to worry about the performance, what would boost the other two?
From experience, things that would badly impact actual performance on a computer that is not infinitely fast...
Which is why the question is stupid. This is not how advancements are made, this is how people are lead down false paths with a dead end. Advancements are made by considering the impact of all important factors...
"There is more worth loving than we have strength to love." - Brian Jay Stanley
So if I screw up and create an infinite loop this computer would complete the loop anyway in only one unit of time?
Not sure how though.
All relationships (e.g. inheritance, type) would automatically be dynamic. A framework for doing static typing and inheritance would be provided as part of the runtime.
Similarly, all components could be naturally and transparently distributed with little or no additional code complexity. That infinite speed could be kept busy making sure there are no race conditions.
Finally, no control structures in the language itself -- all control structures would be part of the runtime and it should be straightforward (if not easy) to add new ones (think Smalltalk or Ruby).
if computers were literally infinitely fast, you could pretty easily replace most of "coding" with brute-force graph search of the program space. the profession of programming as we know it would be obsolete within a few years; it would remain as a quaint curiosity practiced by philosophical lisp-weenies and hardcore enthusiasts. maybe there would be a niche market for "artisanal programs" or something.
"They were pure niggers." – Noam Chomsky
... bubble sort.
It little behooves the best of us to comment on the rest of us.
If they were 'infinitely fast' it wouldn't matter; you could write everything in interpreted BASIC and it wouldn't matter.
Oh it's even worse than that. If you have an infinitely fast computer you never need to program it because a simple random number generator can immediately simulate the effect of an infinitely number of monkeys typing on an infinite number of keyboards in no time at all. Not only will this give you every possible program in every possible language in no time but searching for the right one will be easy too - infinite speed is really useful....and as a side effect you will also produce the works of Shakespeare as well as every other author living, dead or yet to be born as well as their translations into every language using whatever symbols you have on your simulated keyboard.
So even if you ignore whether or not an infinitely fast computer is possible the question itself is logically inconsistent because an infinitely fast computer would not need to be programmed let alone optimized as you pointed out.
If a language was infinitely fast, then any sequence or computation could be executed nearly instantaneously (1 Planck time unit?). That means no more offloading long-running tasks to separate threads, waiting for threads to complete, or even spawning a pool of threads to work in parallel. If a computation is near-instantaneous, then any number of them can be executed and still complete near-instantaneously! Inter-process communication between systems would still exist, but with computations competing near-instantaneously there would be no need to synchronize them. We get to assume that any computation from either system involved in IPC will finish before the next one begins. This will really make life easier. When can I have this new language??
10 Program killer app
20 Make lots of money for me with minimal effort.
30 goto 10
Because math is hard.... and paying for education and experience is not good for corporate bottom lines.
Write a programming language that Middle Managers can use to design our products.
Do not look at laser with remaining good eye.
If computers ran infinitely fast, you would simply emulate nondeterministic algorithms, which means that programs would become verifiers of correct outputs of a bounded size, and you would call an enumerator to enumerator thru all valid encodings of the outputs. The best output is selected. Since the computer runs infinitely fast, this works in a reasonable amount of time.
Would these change how program languages are specified? Probably. Would any of these changes make sense in the real world? Unlikely. You would probably get something like Prolog.
If computers would be infinitely fast and thus also have nigh infinite memory and storage (because fractal compression at zero cost - duh) we'd all inmediately be using what is called a Direct Manipulation Interface (DMI) or Direct Manipulation Environment. Squeak comes close to that, but a good DMI would be something like Flash combined with RunRev using Python or something as a PL, including a touchscreen object modeller for contemporary tablets and some other niceties. The difference between programming and runtime environment would basically completely disappear.
There would be no files anymore, just "Objects" and no starting or stopping of programms, just saved "states" of objects or processes running in and on objects. Again, Squak or RunRev/LiveCode come close to this, but of course are a little flakey to be true contenders for the proposed computing utopia in the GP.
The best experiences I had actually were with Flash, although flashes timeline stuff always was a step backwards vis-a-vis hypercard, squeak and such. But still ... Need a loading bar? Draw one and apply something like >>bar.width = myFile.loading,percentage Done. Doesn't get any better than that short of the computer reading your mind.
I would love to have a Python or JS 2018 driven DMI/DME with triple-A 3D and Flash-style 2D vector graphics. Completely FOSS. That would totally rock!
My 2 eurocents.
We suffer more in our imagination than in reality. - Seneca
Take Python and Javascript. Make it completely unlike them.
Confucius say, "Find worm in apple - bad. Find half a worm - worse."
The first thing you will need is brakes. Pro: no more endless loops!
... with a friend where I was describing what I do for work. I design logic by coding algorithms in Verilog, which gets turned into CMOS circuits by a synthesis tool (effectively a software compiler that turns the programming constructs into CMOS circuits rather than pre-defined instructions for general purpose processor). But this is a very clumsy method of describing even the simplest things. At some point, we concluded, the synthesis tools will get good enough that I will need to merely describe to it at a very high level, perhaps just a spec document, or via a natural language "conversation", and then it takes care of all the ugly details under the hood to implement the idea and turn it the hardware.
I figure the ideal programming language to tell an infinitely fast computer what to do is your natural language. Just have the computer sit in on the meetings between the client and the developer. You'll still need a developer to tell the client that no, they don't want blinking fonts, and help clarify vague and contradictory statements, but then just have the computer build what it heard. With infinite processing power, I am of course assuming that very very good natural language processing is possible.
The language should allow full introspection and reflection as well.
If the computer is infinitely fast, why do we need an ideal programming language?
Different people think in different ways. Some tasks are more easily accomplished in one language than another.
And infinitely fast computer should be the reason we stop creating new flavour of the day languages. Not an excuse to create yet another.
For a graphics engine, this would mean taking the art as the artists originally created it and doing all the processing needed to display it, every frame.
For a web browser, you would re-render starting with the HTML every frame, simply discarding what isn't in the window.
AI would become easier: For a given problem, iterate through all topologies of neural network up to some constant size, train each one, and see which is the smallest that produces the 100% correct results on the training data set. That's likely to be the correct generalization of the problem.
If you had an infinitely fast computer you'd want to be outside it's lightcone so it doesn't vaporize you and everything around you.
An infinitely fast computer with memory leaks will make short work of finite memory.
I am a little concerned with the size of Long Long Long for the infinitely fast computer, too.
The question really is ill-posed. Even without infinite storage, infinite computation collapses the polynomial hierarchy. P = NP, P = PH and in fact P = PSPACE. You could fairly quickly boostrap your way to an AI that would let you describe (in natural language!) the actions you wanted the computer to take and have the computer either write the program or perform the actions directly. No clever programming needed during the bootstrapping, just brute force searches in polynomial space will be fast enough given an infinitely fast computer.
An infinitely fast computer requires PAUSE instruction.
The person that wrote this either never had a course in computability or failed it. The bottom line is that "infinite speed" does not matter in reality, because it turns out to be not the same as "infinite computing power". "Infinite computing power" is provable impossible, it leads directly to a contradiction.
Basically, you would not get much more than what current compilers are already doing, you would just not have to wait for it.
Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
Fantasy Island.
No such thing as infinite is measurable, and certainly not feasible any time soon. A well written and well optimized program will always be faster than one which is lacking.
I've been in this game for decades now and the same thing is assumed. "When computers are fast enough..." Well, the faster the computers go, the more interesting problems become solvable more practically. Sorry to say it CS wannabes, you will never have enough computer speed to waste cycles on ignorance.
At infinite speed a value may arrive at an indefinite state, and you would need a way to inspect this.
Getting rid of garbage collection? Why? There is no performance hit to it. The assumption is not that there is infinite memory.
ANSI C
Do what I want, not what I ask. Include DWIWNWIA and all other features become superfluous.
I just mined all the bitcoins and cracked all the passwords!
...optimizes for you.
Seriously, humanity would be the constraint then, not the computer.
"Infinitely fast" means "divine" — the bottleneck becomes not the computer's ability to understand, but the human's ability to express the commands and instructions. Assuming, such omni-powerful computers would still obey me, I'd program them in Ukrainian. Or English... Does not really matter — being infinitely fast, the computer would be able to translate the programs from one language to another instantly.
Oh, and then, of course, they'd need to humans to program them at all...
In Soviet Washington the swamp drains you.
With an infinitely fast computer I could code an apple pie from scratch.
Presumably, the question is asking about a future where there is a computation breakthrough where current algorithms take a small percentage of available processing.
The answer of course is AI.
But the question does not really make sense.
The real question being asked here is, "How do you make a programming language easier and more idiot-proof?" Right off the bat, there is just no substitute for ability + experience. You need both (or if not experience, a whole lot of ability).
Remember, the thing a programming language does is translate human-readable text into processor instructions - one's and zeros.
How to do that more easily and have the program robustly do exactly what you want? Object oriented is brilliant IMO, for example. Forcing you to make classes (a way to group code), and create complex methods (functions), and just instantiate the object (the mere act of doing so running multiple functions, and being able to call with one line a function that does a whole bunch of stuff.
First there was assembly, line by line interaction with the processor. Then Basic, then function-oriented programs which groups functionality into functions, then object-oriented programming (grouping functionality into classes and their methods), and object-based programming (e.g. JavaScript - everything is an object, except primitives).
What is all this leading to? Trying to take the average human's mental concepts and turn them into machine code in an easier and more error-proof fashion.
Deep stuff for a Slashdot thread. We'd need the likes of Claude Shannon and Bjarne Stroustrup to really bite into this.
People are still going to need to learn the language of the computer, even if/when it could understand natural language ("I wanna add this list of numbers together, divide it by the number of numbers" versus "I want the average of this list of numbers". "And then I want to display it in a flashing red box.").
Christ, what a maintenance nightmare. Ease of generation of machine code versus maintainability? "Why was this asshole doing all this bit shifting in this function?"
Well, hopefully I framed the real question a bit better, got no idea of what the next evolutionary step would be.
You wouldn't have to program an infinitely fast computer, except the one time.
I'd replace a programming language with more of an interview system.
Basically, you'd tell the computer what problem or task you wish it to do. If it knew how to perform the task, then your job is complete. If it doesn't know, it would ask you to break the problem down into smaller sub tasks. You do so and for each sub task that the computer knows how to solve, it would do so. And for each sub task that it didn't know, it would recursively ask how to solve those sub tasks. As for a library, the computer would remember every task that it had been taught previously.
There would still be programmers, but their job wouldn't be using any specific language, but instead describing how to solve problems or perform tasks.
Not being a programmer I have to ask:
Does infinite speed imply infinite resources? Does infinite speed imply strong A.I.? Because that is what most of the posters here seem to be saying.
Back when dinosaurs roamed the earth I took my first theoretical computer science class. The professor drew a Turing machine on the blackboard and said "This is the program that runs forever without producing any output. I'm sure you've all written this program." So what happens if my computer is infinitely fast? One typo and it does an infinite amount of nothing, consuming an infinite amount of power. So if my wiring is good enough I crash the electric grid, and if it isn't my house bursts into flames.
For many algorithms you would just need to specify the constraints on the output and iterate all possible outputs infinitely quickly and pick the best one. The only sorting algorithm would be bogosort.
So a declarative language would seem to fit, or something like prolog.
1. No compilation or build steps
2. No debug mode--it's all debug all the time baby
3. Shared state--my ide knows the state of all users at all times. When a user gets an exception I can just deal with it natively.
4. Reflective unspecified type safety--if a parameter is used as a date in a function, then only let me pass in dates. But don't make me specify the parameter is a date, I am way too lazy.
5. Automatically test everything with each keystroke so that when my tests tell me when I'm done writing code.
6. I would never have any memory management.
7. I wouldn't have to build my teams code t would just be sitting there on my computer already built. Then again, see number 1.
8. For the love of god just log things for me
9. Check in my code for me when the tests pass. No save. Just typing and when test passes, in it goes.
10. no files. No headers. No libraries. No includes. If I need it, it's there. If I don't need it, it's not there.
11. Thinking...is copy and paste a good thing? Why do I need to copy and paste? Maybe my infinitely fast computer should be able to insert code for me.
12. When all my tests pass, a butler is there with a cold brewski on a silver plate.
This problem has previously been posed on stackexchange. You can use this computer to generate the shortest possible code that satisfies a set of unit tests.
Also, the mere existence of such a computer would prove that P=NP, so that would cause some pretty huge shockwaves even without using the computer at all.
People might get tripped up by the word infinitely in the question. I think the point is to ask what features you would want in a language if everyone had much more computing power.
So what happens when my infinitely fast CPU finds an infinite loop?
I read the title originally as "if compilers were infinitely fast" and it actually made sense as a problem question to answer. When you say "computers are infinitely fast" the question becomes dumb because there are a lot of things you can do if computers are infinitely fast which would be dumb to actually do.
"Computer, build a simulation in which early 21st century dreamers respond to this post"
*Beep Beep* "Specify language"
"English"
With infinite speed, any problem can be solved in zero time by trying out all possible inputs. So procedural or functional programming becomes obsolete, because stating the problem is enough. Also, no cryptography.
...where the ZIP file of your source code is already located. No need to code!
Slashdot readers have continuously dropped in my estimation of intelligence article by article in the comments they post. By now, when I read comments here I visualize either a teenager working at a startup fueled by energy drinks or a guy in a wife-beater t-shirt banging out comments from home. Either that, or the smarter people left when the new owners took over (I only check back every once in a great while) as most posts are garbage now.
This is a good intellectual exercise. If we had limitless processor speed (probably by grouping thousands to millions of processors - you could get to the point where your limitation was your ability to think about a problem rather than the processing power you had available), then the limits would be the same limits that big data / data scientists face - how much data can you store, and how much can you receive over the network? Also, many problems are many-dimensional, and our brains are really only good at processing three dimensions.
Anything that helps with visualization will help think through the problem as that's an area where our brains have a massive amount of processing dedicated. Look to computer vision researchers (OpenCV) for clues on what they've been doing - forums where they meet will talk about other APIs.
If we could set problem exploration neural networks out to further research areas and report back to us, that would be awesome. What if instead of having a simple spider, you had an agent that could make search queries and build a model of all the connections related to the problem as it went? If you had a bunch of those looking at many different problems related to a question, you could code simulations quickly and get a better picture of how things might work if a change was made.
One attribute of code is that is should enforce the charter and rights and freedoms of the user.
Second it could not be used for military application by design.
Third a Hippocratic oath of to do no harm.
One could use a genetic algorithm to evolve a solution if time were not an issue. However, the hard part may be defining/building a ranking test.
Table-ized A.I.
Judging from the kind of requirements users often give me, a new computer language really needs to be telepathic. It has to know what the user meant - even when the user has no clue themselves.
It would help if the new computer language could do magic too. That's another user requirement I often get.
I am anarch of all I survey.
lol Java and Python BTFO, so far behind they shouldn't even be allowed in the discussion. Only Microsoft ever took the effort of managing scalable complexity, which is why their OS has lasted 25 years and everyone else gets scurred and drags another dead Unix off the shelf. Yeah right, this Unix will be better. Yeah right, this C imitation will be better. Nope. Without CPU cost it's C#'s game to lose for productivity.
c:\programs\McAfee\Uninstall.exe
Table-ized A.I.
Let's assume we have an infinitely fast computer. You know people will stop caring about Big-O (most already don't care). Plenty of idiots will code non-lazy loops over infinite data structures or make a mistake in recursion* and we'll be back at slow programs which freeze and crash.
*Tail optimized so we don't run out of memory.
Since every calculation will release a finite quantity of energy, an infinite loop would release an infinite quantity of energy consequently destroying the universe. For safety, the programming language should avoid any looping functionality. Or memory allocation. Actually, probably best if there is a one week delay between executing any instruction during which it can be thoroughly analyzed by physicists for possible singularities.
When things get complex, multiply by the complex conjugate.
Studying them is part of course in "Theory of Computation" taught in Computer Science. https://en.wikipedia.org/wiki/... Interestingly, even with "infinitely" fast machines, there will still be problems that may not be computable. https://en.wikipedia.org/wiki/...
I think the #1 feature of the language would be something to slow the computer down a bit, otherwise games will be unplayable.
Nullius in verba
All you ever need.
Oh ok maybe the occasional JavaScript.
without performance problems, you could simplify several things:
Programming Language:
1. no difference between numeric types like int, float, double and replace each with a single high-precision type that is represented as floating-point with 10^x decimals as well as a rational number at the same time
2. no more conversions between types, as every type can be converted to any other type at the same time (reader/writer -> input/output reader/writer -> buffered -> ... )
IDEs:
1. IDEs could compile, build and run all unit-tests after every keystroke
2. IDE's KI could help to provide suggestions and/or stackoverflow code-snippets for your current needs
If computers were made of cheese, what would be the ideal relish to eat with them?
Telling the system: if I input "1,3,7,5,4", I want the output to be "1,3,4,5,7", or just "get me a sorting algorithm". Then the system searches all kinds of known algorithms and picks the one that does this task and is most commonly searched for in a context similar to mine. Then it proceeds by asking me "ok, but what would be your desirable output for '1,2,a'?". I think these days, so much programming actually seems to be recreating things that someone else has already done...
This might also work for what amounts to the biggest nightmare for me when learning new languages and environments - e.g. in Unity3D, I have this button and I have this variable, but being a complete newbie - when I push this button, how to make it change the variable. What are the correct names, methods, events? Again, can I program this by way of example or natural language search, and have the system take care of things like passing parameters?
In other words - superfast computers should just allow me to more easily find and connect work done by others (and released as open source, yippee!)
DoWhatIMean.
45 5F E1 04 22 CA 29 C4 93 3F 95 05 2B 79 2A B2
So basically, no matter how infinitely fast it is we would find a way to make it slow (network access anyone?)
we just need to find a back door out this virtual reality we call the universe and access the "main frame" directly...
Neo.. Follow the white rabbit...
Clearly we should first ask for is an IDE running infinitely smart and fast on that infinitely fast computer.
Programming is such a 20th century concept. Don't you feel like a mere peon, putting so much effort into organizing your thoughts into some framework that someone else has built, of some syntax and structure that someone else has thought of, to get some task of yours done? Irrespective of the complexity of the logic involved, the complexity of the application, the number of interconnected components etc, programming will ultimately be viewed as a plebian activity! I expect when systems are powerful, when the software / hardware combo is advanced sufficiently, you will *not* need to program anything, ever!
Blaming the language for the shortfalls of the programmer. PEBKAC
I've never understood that acronym. The only thing between a keyboard and a computer is a cable. So the problem is the cable? Why not just say cable instead of PEBKAC?
If your computer is infinitely fast, you could use any programming language or constructs you like, it's going to make no difference.
You could code in Visual Basic and run it on Vista, and it'd still run as well as an assembly language application running on MS DOS 6.22.
Infinite performance negates any performance issues entirely. It's kinda the definition of infinite.
while(1) {};
and
int myfunc(int n) {
myfunc(n+1);
}
When the boss asks "Hows that research going?". I can honestly answer "The system is calculating away." then show him 'top' with processors pegged.
Not really the interpreter, but the language spec. Add the following: ...
- Ability to do static typing when needed
- Add optional dialect to use delimiters instead of whitespace for block and statement scoping that can be enabled and disabled within a file.
- Add ability to specify uniform and auto-vectorized parameters to functions and have the system auto parallelize, vectorize, dispatch to GPU,
Many of these may exist in other languages, but I haven't spent a lot of time looking. I'm mostly a c++ and Python guy. Groovy seems to have a lot of cool features, too, but I find it hard to learn because of the too-loose syntax rules.
Dan
If we had access to infinite computational speed, there's no point in wasting time designing a new programming language. There's only one program we ever need to write: a program that produces Strong AI. Once you have the ability to search the entire space of all possible programs and test them against all possible input instantly, all you need to do sufficiently specify the parameters of the program you're looking for, and bam, it's done.
And then once you've written that one program to produce strong AI, you let it do all future tasks that require any thought, not just all future programs we might need.
Oh, and by the way, we also solved the Halting Problem now (at least for classical computers, our new infinitely fast computers will have their own halting problem which they will be unable to solve.).
Well, by the laws of thermodynamics and Landauer's Principle, an infinitely fast computer should be able to give you an infinite amount of energy if you just run:
// Make infinite energy here
while(true)
{
}
Of course, this creates a bit of a security vulnerability, as while you get an infinite amount of energy, there's a bug where that will also destroy the universe - to avoid this, you should probably add in a sleep call somewhere:
// Make infinite energy here
while(true)
{
sleep(1); // Be careful not to destroy the universe
}
I should send an email out to Epic's security team to warn about that one - and get a note added to the coding standards...
This is question is an example of why Slashdot has declined. It is stupid, theoretical and no right answer. Yes, I realize there is debate in the question but, computers have physical limitations. The better question is how to deal with those limitations.
So, this is the day I stop reading Slashdot. Too many stupid questions.
This question is exactly like "If 0=1, what is the best way to prove P=NP?"
GC is bad for all the reasons stated. Often you cannot just "throw another hundred GB of RAM"(???) at a system. It really does screw with application speed, I personally spent LOT of time tuning Java GC for both client and server applications so unlike your theoretical understanding I have a lot of real world battle scars from GC.
There is however a way to do memory management that for the most part does not involve the programmer. It's called ARC, and it works spectacularly well - used by Objective-C and Swift.
It's fully deterministic an imposes no more burden on the programmer than GC does - but at the same time you can for critical parts dictate exactly how memory allocation should work.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
Give me an operator for those rare times when a reference is nullable ('?'), or a value is mutable ('!')
That's pretty much Swift. You can specify nullable with "?" (which turns out not to be that rare in practice), and it has semantics for mutable/non-mutability.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
It would be a self aware computer, and the answer is... ENGLISH
And there would be automatic code optimisation to finish small infinite loops in less than 1 millisecond.
If performance is not an issue an IDE can be used. voila!
I get the car.
--Reverend Jesse Jackson on SNL
English
+1
GC creates more problems than it solves.
The knowledge/discipline needed to use GC properly isn't less than learning to use reference counting.
Worse: In a GC language you'll be retyping the exact same boiler plate code over and over gain to workaround the problem. This leads to copy/paste errors, code verbosity that hides other bugs, forgetting to do it, etc.
GC-enabled languages have *less* boilerplate and verbosity for the most part, because that nuisance housekeeping is handled for you. Unless you're stuck coding in Java perhaps. Many other GC-friendly languages are easy to read, write, understand, and trivially within the "good enough" ballpark for most use.
I agree that some knowledge is useful in terms of edge cases, profiling and tuning, but that's a bridge you cross when you need to.
On a system like that, a programming language would only need one statement:
> Solve_problem;
Forget languages, all you need is one single program that takes an input spec and an output spec and brute forces it's way through every possible program until it finds a solution. However, given that this would be an infinitely large search space, it cannot be determined that an infinitely fast computer would search through this in a finite period of time. So an infinitely fast computer might not be as powerful as it sounds.
On the other hand, an infintely fast computer could perfectly simulate an infinitely fast computer (could perfectly simulate an infinitely fast computer (could perfectly simulate an infintely fast computer .. ))... which would get you infinite geek cred.
Eclipse would still take minute to load though. No way around that.