|
Gary R. Wheeler wrote: I was trying to express the notion that the ability to implement algorithms efficiently depends upon the utility of that algorithm in the target environment.
Okay, fair enough. Though again, I'm still worried about this given this is my first attempt to do something non-trivial with typescript, or even - in years - javascript. The first attempt, and I run into such a fundamental and showstopping limitation it definitely gets the hair on the back of my neck on end, you know?
Gary R. Wheeler wrote: My knowledge of TypeScript/JavaScript is limited. Would it be possible re-implement maps and sets that supported at least a limited form of the capabilities you require?
Not efficiently using JS itself, as far as I can tell. I haven't profiled to be sure, but it's a lot of work for something that probably won't solve the issue.
Gary R. Wheeler wrote: There's the key word (no pun intended).
Which brings me back to me above response, about this being my first real go at TS, and my first time running into a major wall with it. It doesn't bode well at least to me.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
honey the codewitch wrote: if an object changes, its “location” inside a collection has to change, as well. But that’s not what happens in Java. JavaScript will probably go the safer route of only enabling comparison by value for special immutable objects (so-called value objects).
I realize that is not your statement but I will note it is a silly response.
In ANY language if you change the contents of a entities within a collection there is a risk that you violate the constraints of the collection.
Any competent programmer that actually understands a Java HashMap (and similar) must understand the impact of attempting to change the semantics of what equals() and hashcode() actually means.
I can see a Junior developer doing that.
I can also see a Junior developer failing to correctly manage memory allocations in C/C++ also.
But Java is not JavaScript nor are either C/C++.
honey the codewitch wrote: But that’s not what happens in Java
That is perhaps more ludicrous. Is there any language where that happens?
|
|
|
|
|
I agree with you about that response. It seems like they refuse to implement the feature until they can overengineer it.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Quote: It's used on the backend (node.js). It's used on the desktop (angular, react-native).
That is just bad application design. JavaScript on the backend or the desktop is like putting a lawnmower engine in a Chevy Corvette and expecting to get a speeding ticket on the Interstate.
C#, VB.NET, Java/Kotlin, Rust, Python, etc. are much better server-side and desktop languages than JavaScript.
|
|
|
|
|
Big one for me - lack of destructors or finalisers.
|
|
|
|
|
I've gotten so used to garbage collection that I've learned to accept it. I don't like it but it's no longer a huge deal for me.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
It's not a matter of garbage collection. Java, C# and even Python have finalisers that support adding code that is executed when an object is reaped by the GC. This becomes essential when providing a C++ implementation of an object in the target language (say via Emscripten) to arrange for the C++ destructor to be called when the owning object is destroyed by the garbage collector.
Lack of finalisers mean the C++ implementation is limited to PODs (plain ordinary data types), whcih is pretty damn limiting.
|
|
|
|
|
That's fair enough. I didn't realize that limitation of emscripten.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
IMO, any computer language that is Turing-complete is a "real" computer language. As it is possible to implement a Turing machine in JavaScript, it is a "real" computer language.
JavaScript is undoubtedly not the best language for implementation of certain algorithms, but one can find non-performant examples of algorithms in almost any language.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
I have long dreamed of a universal 'meta language' to describe a task.
And of course also then, 'simply' writing tools that converts this 'meta language' into the currently available tools.
I think this is pretty much on your wavelength with parsers, whatever...
modified 27-Dec-23 11:42am.
|
|
|
|
|
Myself I am waiting for that self conscious highly intelligent robot butler which is self repairing and runs for a thousand years on its internal power source.
Then I could just tell it to do my job for me. And clean the kitchen.
Perhaps also to chase me around the house with a stick so I get enough exercise too.
|
|
|
|
|
Not sure, but you answer with irony? But what I have in my mind is the next step from compiler-compiler
|
|
|
|
|
0x01AA wrote: long dreamed of a universal 'meta language'
It cannot exist.
That is why so many languages exist. Reasons vary but in general a need was not being met or the newer one was supposed to be better.
If anything you can look to the many languages that use the Java VM and yet they are not Java. That is not the only language platform where other languages were built on it.
|
|
|
|
|
honey the codewitch wrote: I went about porting my DFA lexer engine from C# to TypeScript
Just noting that javascript has a very feature rich regular expression support.
honey the codewitch wrote: allow you to implement computer sciencey algorithms and constructs
Your description is incomplete. From what I read in your comment it does allow you to do it.
It just is not as fast as you like/want.
honey the codewitch wrote: is one example but I can basically crash it or stall it out for a long time at least with any non-trivial expression.
Perhaps this is your basis? Without having looked at that solution at all, I can only note that being Turing complete does not mean that the language has no bounds. That is not part of the description. And all languages would fail at that.
honey the codewitch wrote: or is it just being adopted because we can?
I know a business that was sold for quite a bit of money which ran high performance high volume real time data processing using javascript.
Not the platform I would choose and I don't know what hardware costs were. But they certainly did it some how.
I doubt most others would choose that also. For complex systems one often uses a mix of technologies.
|
|
|
|
|
jschell wrote: Just noting that javascript has a very feature rich regular expression support.
Can't lex, and won't fulfill the project requirements, which are "learn typescript"
jschell wrote: Your description is incomplete. From what I read in your comment it does allow you to do it.
It just is not as fast as you like/want.
There is a point where something takes too much time and space to be practical. That is a real thing. That is the issue here.
So no, it's not "just not as fast as I'd like", it is not usable.
jschell wrote: Perhaps this is your basis? Without having looked at that solution at all, I can only note that being Turing complete does not mean that the language has no bounds. That is not part of the description. And all languages would fail at that
It's not. Really none of this is relevant.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
honey the codewitch wrote: which are "learn typescript"
lol...well yes that doesn't work.
honey the codewitch wrote: There is a point where something takes too much time and space to be practical. That is a real thing.
At least with regular expressions, in general (so perhaps not your solution, or could be) it is possible to create ones that will never end. Or will take days to complete.
So that by itself is not a determinate.
|
|
|
|
|
This isn't even to run the expression, just to turn it into a state machine.
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Assembler is the only "real" language, everything else is just syntactic sugar.
"A little song, a little dance, a little seltzer down your pants"
Chuckles the clown
|
|
|
|
|
An assembler is what assembles an assembly language. And, of course, even that is just syntactic sugar over machine language.
|
|
|
|
|
And machine language is only syntactic sugar over the rearrangement of charges in the CPU, memory, etc.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
To be fair though the charges are not a language.
Although, far as I know, all modern processors use 'micro-code'. Googling does not really answer if that is Turing Complete though.
|
|
|
|
|
If you can build a Turing machine out of arrangements of electron charges (which you obviously can), then I would claim that it meets my definition of computer language.
We don't usually think of that as a language, but it is no more arbitrary than using certain shapes to represent letters is.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Real programmers use butterflies.
*hides*
Check out my IoT graphics library here:
https://honeythecodewitch.com/gfx
And my IoT UI/User Experience library here:
https://honeythecodewitch.com/uix
|
|
|
|
|
Obligatory xkcd: Real Programmers
Real programmers use emacs!
(Dons asbestos suit, runs and hides)
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Daniel Pfeffer wrote: If you can build a Turing machine out of arrangements of electron charges (which you obviously can)
And computers are built using atoms but I am not going to claim that atoms are computers.
|
|
|
|