Re: Interesting findings on the internet
Posted: Fri Apr 12, 2024 10:00 am
I have no beef with Swindon. It's just a nothing. Like Peterborough.
Test equipment addicts, unite!
https://teanonymous.com/f1/
He seems a little perverse about the 0/1 thing. The simple point is that an N-bit number can express 0..2N-1, not 1..2N. Even as a kid, it rankled with me that the first ten numbers are 1,2,3,4,5,6,7,8,9,10. It also rankled with me that The best composer is Beethoven, and The Russian composer is Tchaikovsky. Never liked either; always preferred Bach and Scarlatti.bd139 wrote: ↑Fri Apr 12, 2024 12:27 pm A very interesting read on the notion of 0 and 1 based array indexes
https://exple.tive.org/blarg/2013/10/22 ... on-needed/
I'm honestly on the fence with the 0/1 at the moment. There are times each makes sense. Everyone gets pissy if you use the wrong one. There is a nice demonstration of integers being representable as the difference of natural numbers (m,n) which is handy when you have identities -n_=(0,n), m_=(m,0) and 0=(0,0) but this is a pain in the but if you have m_=(m+1,1) and n_=(1,n+1). That is the only viable complaint I've seen. Everything else seems arbitrary. Arrays are easier. Cardinality is no worsetggzzz wrote: ↑Fri Apr 12, 2024 3:48 pmHe seems a little perverse about the 0/1 thing. The simple point is that an N-bit number can express 0..2N-1, not 1..2N. Even as a kid, it rankled with me that the first ten numbers are 1,2,3,4,5,6,7,8,9,10. It also rankled with me that The best composer is Beethoven, and The Russian composer is Tchaikovsky. Never liked either; always preferred Bach and Scarlatti.bd139 wrote: ↑Fri Apr 12, 2024 12:27 pm A very interesting read on the notion of 0 and 1 based array indexes
https://exple.tive.org/blarg/2013/10/22 ... on-needed/
The one about square brackets rings true. Back Then there were many many different keyboard layouts; the letters and numbers were more or less fixed, but the rest appeared all over the place - and you had a few odd keys/characters like "figure shift" and "letter shift". Until recently it was easy to type square brackets; now it is a pain in the arse to type, say, bd139:FUCK PHPBB PARSER! on a fondleslab; we now have three shift keyboards to deal with
Gabriel's The Rise of Worse id Better is spot on, of course I liked C in the early 80s, but by the early 90s I merely tolerated it; I knew there were better alternatives (no, not C++ of course!)
I was apologising for not thinkingbd139 wrote: ↑Fri Apr 12, 2024 9:24 pm No need to apologise for the shortcomings of a badly designed markup language and bit of software
I dislike Go less. That's all I'm saying.
Currently playing with Julia. It has some interesting capabilities and is compiled using LLVM on the fly to something actually fast...
Screenshot 2024-04-12 at 22.24.07.png
Slough is the pits, I used to spend loads of time with customers there and I just couldn't get away quick enough, I loathed it.
Slough smells of dust, stale piss, and Maltesers.Specmaster wrote: ↑Sat Apr 13, 2024 2:40 pm It also used to have a sickly smell hanging around from the huge great Mars factory there.
So far so good. My application for it is actually numerical computing and modelling (Ferengi stock market shenanigans) so that pretty much hits the nail on the head. It also has decent stats package with data frames and reporting functionality. I was using R for this but it's showing its age and crankiness for the task.tggzzz wrote: ↑Fri Apr 12, 2024 11:01 pmI was apologising for not thinkingbd139 wrote: ↑Fri Apr 12, 2024 9:24 pm No need to apologise for the shortcomings of a badly designed markup language and bit of software
I dislike Go less. That's all I'm saying.
Currently playing with Julia. It has some interesting capabilities and is compiled using LLVM on the fly to something actually fast...
Screenshot 2024-04-12 at 22.24.07.png
I'm aware of Julia, and at first glance it seems like something I would investigate further - but only if there was a reason I might want to use it. From the little I've seen, my two questions would be whether it offers sufficient over other languages, and what's the quality of the libraries and tool support.
I've written a fair bit of Java over time. This migrated to c# which is roughly equivalent but without some of the horrible design mistakes Java made along the way (missing then terrible generics). I'd be lying if I didn't agree with you though. It paid the mortgage off. But it was very easy to build unwieldy abstractions on top of through over-engineering and that's exactly what happened. Using the core of either Java or .Net is a radical approach these days and shunned by the framework architect religious types.tggzzz wrote: ↑Fri Apr 12, 2024 11:01 pm Whatever else you might think of Java, the range of libraries that rapidly appeared and simply worked with each other was stunning. In one year it was orders of magnitude better C++ had managed in a decade. The tool support rapidly appeared, and the "cntl-space" "what can I do here" anticipation is something that C++ can never match.
Dr Ivan Mcraisey's Original Turd Polish as well.tggzzz wrote: ↑Sat Apr 13, 2024 10:06 am I wish I had known of this paste a few years ago. I suspect BD might still find a use for it...
Sullivan Supply Attitude Adjustment Paste
https://www.amazon.com/Sullivan-Supply- ... B08X97BXWV
Might still be worth buying one, to display alongside "BUM scouring powder" and "Fat-free Sour Cream". When on the west coast of LeftPondia, I should also have nicked breakfast menus proclaiming "egg-free omelettes".
I would argue Perl is neither intuitive or proper. It's one of those things that sort of, well, happened. I inherited a lot of it (Horrible parsing and mucky Perl CGI) back in the early 00's and ended up porting it to C# rather than trying to fix it. That product is still in production today apparently (Association of mathematics teachers membership system).
Oh, how... passé. And pleasing.
Java generics are suitable for avoiding downcasting when using containers, and not much more. I have successfully used them for more, but it was a trial-and-error pain only possible because I wasn't under time pressure.I've written a fair bit of Java over time. This migrated to c# which is roughly equivalent but without some of the horrible design mistakes Java made along the way (missing then terrible generics).tggzzz wrote: ↑Fri Apr 12, 2024 11:01 pm Whatever else you might think of Java, the range of libraries that rapidly appeared and simply worked with each other was stunning. In one year it was orders of magnitude better C++ had managed in a decade. The tool support rapidly appeared, and the "cntl-space" "what can I do here" anticipation is something that C++ can never match.
Yeah. Sod 'emI'd be lying if I didn't agree with you though. It paid the mortgage off. But it was very easy to build unwieldy abstractions on top of through over-engineering and that's exactly what happened. Using the core of either Java or .Net is a radical approach these days and shunned by the framework architect religious types.
By the time Go was being designed, they had plenty of examples to "copy", dating back to to the late 70s early 80s That they did copy (cf reinventing an elliptical wheel!) is a principal reason I've kept an eye on Go.Again saying good things about Go, it had people who knew how to build a decent and powerful standard library on the project. It's rare I need to pull in a 3rd party dependency.
For 2023 mine are:So conclusions for 2024 so far...
Julia -> scientific computing / stats / modelling
Go -> everything else
It's a glorious concoction of C, shell script, both of which I knew quite well, (and so I found it intuitive) and a few things of its own. I found it did what I wanted very well. It had the huge CPAN libraries.bd139 wrote: ↑Sun Apr 14, 2024 9:23 amI would argue Perl is neither intuitive or proper. It's one of those things that sort of, well, happened. I inherited a lot of it (Horrible parsing and mucky Perl CGI) back in the early 00's and ended up porting it to C# rather than trying to fix it. That product is still in production today apparently (Association of mathematics teachers membership system).
You can tell it's not proper because they tried to make it a proper language recently and no one used it because if you want a proper language there are plenty of others to choose from
It fell from prominence because it had numerous problems including performance, scalability and the notion of being a write once language. Also the propensity for people to try and solve everything with layers of regular expressions and naive parsing.Zenith wrote: ↑Sun Apr 14, 2024 3:33 pmIt's a glorious concoction of C, shell script, both of which I knew quite well, (and so I found it intuitive) and a few things of its own. I found it did what I wanted very well. It had the huge CPAN libraries.bd139 wrote: ↑Sun Apr 14, 2024 9:23 amI would argue Perl is neither intuitive or proper. It's one of those things that sort of, well, happened. I inherited a lot of it (Horrible parsing and mucky Perl CGI) back in the early 00's and ended up porting it to C# rather than trying to fix it. That product is still in production today apparently (Association of mathematics teachers membership system).
You can tell it's not proper because they tried to make it a proper language recently and no one used it because if you want a proper language there are plenty of others to choose from
It fell from prominence because Larry Wall became distracted and it became riven by politics.
Define a "proper" language. I recall that at one time, Pascal was the ultimately proper language, although it's been pretty much dead for some years. People raved over it. Wirth developed it as a teaching medium and was shocked that compilers had been written to implement it. He set to work to create Modula 2, with much stronger typing. That never caught on.
It is actually. Very nice when you have a thing on your plate of "evaluate this complicated distributed system" and it turns out this is done by downloading a single binary, running it and that's it. Our entire logging (loki/promtail) and metrics system (prometheus/alertmanager) and visualisation (grafana) is sitting on top of it. You can literally bring the whole thing up on your laptop in about 5 minutes. We started building utility applications in it and they start up fast, run fast and bugger off quickly.
The problem with Java is that the generic implementation is unboxing and boxing which is time consuming. C# actually natively compiles this, again using JIT. There isn't really AOT optimisation although promised in C#. It never materialised. It's like cold fusion.tggzzz wrote: ↑Sun Apr 14, 2024 9:37 am Java generics are suitable for avoiding downcasting when using containers, and not much more. I have successfully used them for more, but it was a trial-and-error pain only possible because I wasn't under time pressure.
Chash never interested me. Hejlsberg came and gave us a talk just before it escaped. Nobody in the audience was impressed, since it didn't offer anything radical over Java. Basically it was (and is) a traditional me-too Microsoft attempt to lock people into Windows.
The only distinctive thing was its ahead of time assembly optimisation. Sounds good on paper, but causes immensely slow installation/update time delays, and is limited to static optimisations. It can only optimise what it guesses will be runtime behaviour, whereas HotSpot can optimise the actual runtime behaviour. (See HP's Dynamo for surprising results which surprise the young/ignorant!)
Learning from other people's mistakes is good.
A reasonable choice too
I thought boxing/unboxing was only relevant for int/Integer and other primitive types, and was irrelevant for non-primitive classes. I can't recall putting naked primitives into a collection class.bd139 wrote: ↑Mon Apr 15, 2024 7:18 am The problem with Java is that the generic implementation is unboxing and boxing which is time consuming. C# actually natively compiles this, again using JIT. There isn't really AOT optimisation although promised in C#. It never materialised. It's like cold fusion.
Warm up time is a "which day of the week is it thing" for me. On Mondays I like the fast load and start, and don't mind the slight performance penalties at the beginning of running. On patch Tuesday I hate having a machine crippled while it installs updates (or would if I had such machines connected to the net). On Wednesdays I hate having to have "warm up" periods when doing benchmarking. On Thursdays I hate have to explain to another youngster about why the university lessons about performance don't apply to Java on modern SMP machines.JIT compilers have some downsides which I am no longer a fan of. I much prefer entirely ahead-of-time compilation even if the solution is less optimal because the principal problems these days are warm up time and latency. It's a bit difficult swapping out a couple of hundred megs of code when there are 6000 requests/second landing on it without annoying someone. The warm up code which makes sure the hot paths aren't going to kill users is pretty hefty and requires a lot of maintenance. cost-benefit shot.
Oh yes indeed. When Java was first announced, Gosling's whitepaper was a beautiful contrast to the stuff emitted by the C++ community. That convinced me Java was a good way to goLearning from other people's mistakes is good.
It's more that if you have an ArrayList<Integer> then add(1) will autobox it from a primitive to a reference type which is costly at bytecode/JIT level whereas in C# this is natively supported thus is not costly.tggzzz wrote: ↑Mon Apr 15, 2024 9:00 amI thought boxing/unboxing was only relevant for int/Integer and other primitive types, and was irrelevant for non-primitive classes. I can't recall putting naked primitives into a collection class.bd139 wrote: ↑Mon Apr 15, 2024 7:18 am The problem with Java is that the generic implementation is unboxing and boxing which is time consuming. C# actually natively compiles this, again using JIT. There isn't really AOT optimisation although promised in C#. It never materialised. It's like cold fusion.
That's fine but it's a leaky performance abstraction. I like my food served hot and ready. I don't want my egg to start cooking the moment I poke it with a fork.tggzzz wrote: ↑Mon Apr 15, 2024 9:00 amWarm up time is a "which day of the week is it thing" for me. On Mondays I like the fast load and start, and don't mind the slight performance penalties at the beginning of running. On patch Tuesday I hate having a machine crippled while it installs updates (or would if I had such machines connected to the net). On Wednesdays I hate having to have "warm up" periods when doing benchmarking. On Thursdays I hate have to explain to another youngster about why the university lessons about performance don't apply to Java on modern SMP machines.JIT compilers have some downsides which I am no longer a fan of. I much prefer entirely ahead-of-time compilation even if the solution is less optimal because the principal problems these days are warm up time and latency. It's a bit difficult swapping out a couple of hundred megs of code when there are 6000 requests/second landing on it without annoying someone. The warm up code which makes sure the hot paths aren't going to kill users is pretty hefty and requires a lot of maintenance. cost-benefit shot.
The maintenance for HotSpot internals are an externality, and of no more interest to me than compiler internals
Indeed. C++ is a bad solution for everything. You can tell this when there are more guides about which bits not to use than bits to use.tggzzz wrote: ↑Mon Apr 15, 2024 9:00 am Oh yes indeed. When Java was first announced, Gosling's whitepaper was a beautiful contrast to the stuff emitted by the C++ community. That convinced me Java was a good way to go
C++ discussions were always about C++; it had the stink of "we've had this neat idea and figuring out how to use it isn't out problem".
By contrast, Gosling took a bit from this community (because x), a bit from that community (because Y), ignored a bit from another community (because Z), and demonstrated why the chosen concepts worked well together as a whole.
A perfect use case. Of course make sure that you didn't accidentally include any Arduino C++ crap in it. I wrote my own semi-functional RTOS and libraries and used AVR-libc rather than touch that steaming pile.
When I have done something close to that, the integer will have been fetched from a distributed key-value "database". I know what not to bother optimisingbd139 wrote: ↑Mon Apr 15, 2024 9:42 amIt's more that if you have an ArrayList<Integer> then add(1) will autobox it from a primitive to a reference type which is costly at bytecode/JIT level whereas in C# this is natively supported thus is not costly.tggzzz wrote: ↑Mon Apr 15, 2024 9:00 amI thought boxing/unboxing was only relevant for int/Integer and other primitive types, and was irrelevant for non-primitive classes. I can't recall putting naked primitives into a collection class.bd139 wrote: ↑Mon Apr 15, 2024 7:18 am The problem with Java is that the generic implementation is unboxing and boxing which is time consuming. C# actually natively compiles this, again using JIT. There isn't really AOT optimisation although promised in C#. It never materialised. It's like cold fusion.
Yeah, but you end up getting something the chef decided you wanted when he created the buffet. I prefer something put together when I want it.That's fine but it's a leaky performance abstraction. I like my food served hot and ready. I don't want my egg to start cooking the moment I poke it with a fork.tggzzz wrote: ↑Mon Apr 15, 2024 9:00 amWarm up time is a "which day of the week is it thing" for me. On Mondays I like the fast load and start, and don't mind the slight performance penalties at the beginning of running. On patch Tuesday I hate having a machine crippled while it installs updates (or would if I had such machines connected to the net). On Wednesdays I hate having to have "warm up" periods when doing benchmarking. On Thursdays I hate have to explain to another youngster about why the university lessons about performance don't apply to Java on modern SMP machines.JIT compilers have some downsides which I am no longer a fan of. I much prefer entirely ahead-of-time compilation even if the solution is less optimal because the principal problems these days are warm up time and latency. It's a bit difficult swapping out a couple of hundred megs of code when there are 6000 requests/second landing on it without annoying someone. The warm up code which makes sure the hot paths aren't going to kill users is pretty hefty and requires a lot of maintenance. cost-benefit shot.
The maintenance for HotSpot internals are an externality, and of no more interest to me than compiler internals
But but but that a benefit: you can choose, the language didn't dictate to youIndeed. C++ is a bad solution for everything. You can tell this when there are more guides about which bits not to use than bits to use.tggzzz wrote: ↑Mon Apr 15, 2024 9:00 am Oh yes indeed. When Java was first announced, Gosling's whitepaper was a beautiful contrast to the stuff emitted by the C++ community. That convinced me Java was a good way to go
C++ discussions were always about C++; it had the stink of "we've had this neat idea and figuring out how to use it isn't out problem".
By contrast, Gosling took a bit from this community (because x), a bit from that community (because Y), ignored a bit from another community (because Z), and demonstrated why the chosen concepts worked well together as a whole.
It fitted in an 8-pin ATtiny85 processor, and - even using the arduino digital read/write abstractions - ran fast enough.A perfect use case. Of course make sure that you didn't accidentally include any Arduino C++ crap in it. I wrote my own semi-functional RTOS and libraries and used AVR-libc rather than touch that steaming pile.
It of course depends on what you are doing. We had some low latency stuff running through the reactor patter (only way to get a managed language to perform well enough) that this was offensive enough to cause issues. Totally eliminated by modern CPUs of course now.
Actually the nature of what I want is all the food variations to be cooked up front ready to go.
They are surprisingly fast. Anyone who's written anything 8-bit-ish in the dark ages (I started on 6502 assembly) knows how fast things can be even on slow old things!
Ha. The implementation was extremely light. The entire code for it was 800 bytes approximately and other than intialisation code was actually a header file. It had two functions: doing more than one thing and responding to interrupts. Everything else was bolted on. And it used coroutines which could yield at any point arbitrarily. The real time guarantee came from if it didn't yield it was yielded anyway.
That is roughly how my somewhat giant commissions processing constraint resolver works. If only I had the opportunity to use it on an interesting problem.tggzzz wrote: ↑Mon Apr 15, 2024 11:54 am Nowadays I prefer event-driven designs using the half-sync-half-async design pattern. https://www.dre.vanderbilt.edu/~schmidt/PDF/PLoP-95.pdf and https://java-design-patterns.com/patter ... alf-async/ That works from bare silicon up to telecoms enterprise applications Only thing left for an RTOS to do is encapsulate the networking/USB comms libraries that I don't want to think about