News for hackers. Stuff that matters.
Re:Microsoft rewrote Q# compiler in Rust by bitwize on Wednesday June 21, 2023 @04:45PM (#36424181)
I don't think any language sparks joy the way Rust does -- not even Lisp and certainly not C# or F#. Rust gives the compiler lower memory overhead and attracts a broad base of developers.
Re:Microsoft rewrote Q# compiler in Rust by tmtvl on Wednesday June 21, 2023 @05:21PM (#36424751)
YMMV, of course, I have a hard enough time managing with one style of brackets, Rust has, what, five (round brackets, square brackets, curlies, angles, and vertical bars)? Never mind the fact that some operators are prefix:

  do_something(a_thing);
Others are infix:

  x = a + b * c;
And yet others are postfix:

  foo.frobnicate()?;
My sole braincell can't handle all that complexity, which is why I'll just stick with simple old Lisp.
Re:Microsoft rewrote Q# compiler in Rust by antonvs on Wednesday June 21, 2023 @05:06PM (#36424503)
> I don't think any language sparks joy...

Let the Marie Kondofication of programming languages begin.

But one of Kondo's points is that "Only you can know what kind of environment makes you happy," i.e. there are no universals.

Re:Microsoft rewrote Q# compiler in Rust by ohgodplsno on Wednesday June 21, 2023 @05:11PM (#36424591)
Begin?

The entire reason we have people trying to cram JavaScript everywhere is that, for some reason, it sparks joy for them.

Hell, even going back, K&R vs Allman brace style was about what sparked joy. Color themes? Spark joy. At this point, I am convinced that the way to get a software developer to do anything is to just play on that need for joy.

Re:Microsoft rewrote Q# compiler in Rust by insanitybit on Wednesday June 21, 2023 @05:20PM (#36424738)
> The entire reason we have people trying to cram JavaScript everywhere is that, for some reason, it sparks joy for them.

Wait really? I feel like it's just "you literally have no choice for frontend" and the various side effects of that.

Re:Microsoft rewrote Q# compiler in Rust by ohgodplsno on Wednesday June 21, 2023 @05:30PM (#36424884)
That would explain frontend, yes. But that would not explain NodeJS, JavaScript for embedded microcontrollers, and so many more.

Some might say it's Stockholm syndrome, but then there's the Python developers doing the same thing everywhere. And the LISP enthusiasts. So unless there's a lot of Stockholm syndrome (although it's not out of the question when it comes to LISP), a lot of it is easily explained by "me like language here, me go put language elsewhere to keep language"

Re:Microsoft rewrote Q# compiler in Rust by sudodude on Wednesday June 21, 2023 @07:30PM (#36426191)
I think that's just entrenchment at work. When the majority of your developers only know x languages, and one of them is always js, you tend to work by the lowest comments denominator and the tools that everyone can work with are the ones that stick.
Re:Microsoft rewrote Q# compiler in Rust by Turskarama on Wednesday June 21, 2023 @07:33PM (#36426218)
You're overthinking it. We have Javascript on the server because Javascript was a very commonly known language already (due to being the only choice for web) and the average programmer (one who doesn't post on these forums) is not going to bother to learn another language if they don't have to.

The easiest way to turn front end developers into full stack developers was to let them use the same language for everything, and it was easier to bring JavaScript to the server than to bring any other language to the web.

These days with WASM and JavaScript as compilation targets it might have been avoided, but it's already too late.

Anyway I rambled a bit but the point is "joy" has nothing to do with it.

Re:Microsoft rewrote Q# compiler in Rust by sudodude on Wednesday June 21, 2023 @10:40PM (#36427404)
I think that's just entrenchment at work. When the majority of your developers only know x languages, and one of them is always js, you tend to work by the lowest comments denominator and the tools that everyone can work with are the ones that stick.
Re:Microsoft rewrote Q# compiler in Rust by Turskarama on Wednesday June 21, 2023 @11:45PM (#36427795)
That's true, and I also think it's a mistake.

Any decent developer can become competent with a new language in a matter of weeks, whereas making a large application with the wrong choice of language and tooling can become a maintenance nightmare. Given how difficult it is to verify JavaScript programs as "correct", its use on the server has always riled me up.

Re:Microsoft rewrote Q# compiler in Rust by insanitybit on Thursday June 22, 2023 @09:17AM (#36431702)
> But that would not explain NodeJS, JavaScript for embedded microcontrollers, and so many more.

I'm only going to address NodeJS because I think that niche projects that target niche workloads are just unrelated.

I believe it does explain NodeJS. The idea is simple - your frontend engineers can own your edge services/ APIs. They're already heavily invested in JS and, at least at one point, there was a theory that unifying languages across frontend + edge made sense for other reasons.

Some people really just learn one language.

Re:Microsoft rewrote Q# compiler in Rust by jacobyoder on Thursday June 22, 2023 @10:21AM (#36432596)
> Some people really just learn one language.

I think that's a gross oversimplification. My colleagues know JavaScript, TypeScript and ECMAScript, as well as YAML, HTML and CSS.

Re:Microsoft rewrote Q# compiler in Rust by insanitybit on Thursday June 22, 2023 @12:28PM (#36434635)
I'm not trying to be mean but are you being sarcastic? I... can't tell...
Re:Microsoft rewrote Q# compiler in Rust by jacobyoder on Monday June 26, 2023 @08:52AM (#36479083)
At this point, I can't really tell either.
Re:Microsoft rewrote Q# compiler in Rust by comboy on Wednesday June 21, 2023 @05:32PM (#36424921)
> I am convinced that the way to get a software developer to do anything is to just play on that need for joy.

Works outside software development too.

Re:Microsoft rewrote Q# compiler in Rust by antonvs on Wednesday June 21, 2023 @07:54PM (#36426416)
I think the Javascript example is more about what people are already familiar with. Same goes for languages like Python. Other languages can't "spark joy" if you're not familiar or comfortable with them.
Re:Microsoft rewrote Q# compiler in Rust by rmwaite on Thursday June 22, 2023 @10:21PM (#36442049)
I agree with this. I use Fantasque Sans Mono for the same reason - k with a loop makes me feel warm and fuzzy for some reason.
Re:Microsoft rewrote Q# compiler in Rust by lionkor on Wednesday June 21, 2023 @04:55PM (#36424322)
Whichever language one prefers sparks joy like Rust does for you
Re:Microsoft rewrote Q# compiler in Rust by miohtama on Wednesday June 21, 2023 @05:02PM (#36424452)
While this is true on individual level, Rust has been ranked most liked programming language in many surveys and sparks joy to most of people more than other languages

https://survey.stackoverflow.co/2023/#section-admired-and-de...

Re:Microsoft rewrote Q# compiler in Rust by antonvs on Wednesday June 21, 2023 @05:07PM (#36424532)
What's missing from a survey like that is correlation with prior experience and education. Python was a previous winner on those kind of surveys, and it's a terrible language in many ways.
Re:Microsoft rewrote Q# compiler in Rust by miohtama on Wednesday June 21, 2023 @05:23PM (#36424795)
Where you are failing here is likely empathy, or understanding how other people work or think. This might be because lack of experience in programming, or just because of reflexive negativity. Even if you think Python is a terrible language, for many people it’s the best language for the job. This also includes must PhDs, because Python is the most used languge in science and academia.

When doing critical thinking, please set asides your own biases and try to understand that your own viewpoint is not always the correct one.

Re:Microsoft rewrote Q# compiler in Rust by brokenkebaby on Wednesday June 21, 2023 @07:41PM (#36426293)
This answer looks unjustifiably overheated for a statement that says X is "terrible in many ways". It can be the best tool for someone, and still be terrible in many ways, no contradiction here.
Re:Microsoft rewrote Q# compiler in Rust by antonvs on Wednesday June 21, 2023 @07:50PM (#36426381)
I understand why people use Python. However, I'm just assessing it from a technical perspective, not an emotional one.
Re:Microsoft rewrote Q# compiler in Rust by patrec on Wednesday June 21, 2023 @05:30PM (#36424894)
I think you are a bit detached from reality if you think controlling for experience and education would massively change the picture for python, which evidently enjoys above average popularity with anyone from junior devs to elite programmers (such as Google's Director of Research, geohot etc.).
Re:Microsoft rewrote Q# compiler in Rust by antonvs on Wednesday June 21, 2023 @07:34PM (#36426230)
The issue is what they're educated in. It's not generally programming languages.
Re:Microsoft rewrote Q# compiler in Rust by patrec on Wednesday June 21, 2023 @08:33PM (#36426658)
What makes you think so? If you've got a background in programming languages, maybe you'll roll your eyes at Guido not getting reduce or tail recursion, or CPython's unsophisticated runtime and under-specified/messy semantics, or whatever, but I'm kind of struggling to see why you'd be particularly down on python compared to other languages that (in the average case) have non-negative utility for software development.
Re:Microsoft rewrote Q# compiler in Rust by antonvs on Wednesday June 21, 2023 @08:48PM (#36426763)
I mentioned Python simply because it was ranked highly in some of these kinds of surveys, even though it has quite a few well-known problems as a language. It demonstrates that ranking in such surveys is not necessarily correlated with the capabilities or fitness for purpose of the language.

In some ways, Python is in fact worse than many of the mainstream alternatives - for example, it's not unusual for people to look to rewrite Python systems in some other language because of performance issues at scale. Same (if not worse) goes for Ruby.

Re:Microsoft rewrote Q# compiler in Rust by brokenkebaby on Wednesday June 21, 2023 @08:01PM (#36426457)
I cannot help but notice that Perl used to be very popular in early web development, sys administration, and in a a row of scientific fields. And lots of people were enthusiastic about it (as witnessed by CPAN content). Then it was declared unsuitable for teaching (many ways to do everything), and the next gen who started with Python usually claim that Perl is bad, while among older generation who matured cooking Perl scripts you still can hear that Python is nothing more than a less flexible, less expressive Perl's bastard child. So yes, I think, education (and the first usable programming language learned in particular) influence popularity very much.
Re:Microsoft rewrote Q# compiler in Rust by IshKebab on Wednesday June 21, 2023 @05:22PM (#36424777)
Yeah someone needs to do a ranked preference test. Rank all the languages you are familiar with...
Re:Microsoft rewrote Q# compiler in Rust by tmtvl on Wednesday June 21, 2023 @06:42PM (#36425691)
Funnily enough I'm not very familiar with languages I don't like, probably because I elect not to use them.
Re:Microsoft rewrote Q# compiler in Rust by antonvs on Wednesday June 21, 2023 @07:49PM (#36426374)
Limiting to relatively well-known general-purpose languages I've used in commercial system development:

Haskell, Scheme, OCaml, SML, Rust, Typescript, Smalltalk, Java, Scala, Common Lisp, Kotlin, C, C++, C#, Javascript, Forth, Delphi/Object Pascal, Turbo Pascal, Python, BASIC (various flavors), Fortran.

How about you?

Re:Microsoft rewrote Q# compiler in Rust by nequo on Wednesday June 21, 2023 @08:43PM (#36426725)
What was your commercial application for SML?
Re:Microsoft rewrote Q# compiler in Rust by antonvs on Wednesday June 21, 2023 @09:02PM (#36426849)
We developed the definitional model of a financial instrument modeling and simulation system in SML. The system included a DSL for specifying instrument models, so part of what the SML implementation did was act as a denotational semantics for that language.

The intent was never to deploy it using SML, it was to flesh out and formalize the design, and act as a specification for development of the full system.

The system was designed to run on a cluster long before the Kubernetes days, and so had to deal with many of the distribution, scaling, and concurrency issues itself, in addition to its business logic.

One of the experiences I had while working on that system was that at the time, I was reading "Monad Transformers and Modular Interpreters" - a seminal paper by Liang, Hudak, and Jones - and I thought I could probably quite easily implement the paper's approach using ML parameterized modules, instead of the Haskell typeclasses used in the paper. I tried it, and was soon disabused of that notion. Partly as a result of that, we wrote the distributed simulation engine for a later version of the system in Haskell.

Re:Microsoft rewrote Q# compiler in Rust by IshKebab on Thursday June 22, 2023 @09:02AM (#36431507)
I'd probably go

Rust, Typescript, C++, Go, Java, OCaml, Python, Javascript, Matlab, PHP, SystemVerilog, CMake, C, Bash

Ok I will make this site. :)

Re:Microsoft rewrote Q# compiler in Rust by antonvs on Thursday June 22, 2023 @09:41AM (#36432021)
Oh I left PHP and Go out of my list, my subconscious blocked them out of existence. They'd be near the bottom anyway. I suppose Go with polymorphic types might be worth another look, but before that it was dead to me.
Re:Microsoft rewrote Q# compiler in Rust by IshKebab on Thursday June 22, 2023 @04:08PM (#36438113)
I feel like Go is a so-so language with amazing infrastructure. How many other languages come with built in easy cross compilation, fuzzing, PGO, etc?

It is really unsurpassed in that regard, which is probably partly why it is so popular in DevOps. If only the language was a bit better...

It's definitely not a bad language like PHP though.

Re:Microsoft rewrote Q# compiler in Rust by Patrickmi on Sunday June 25, 2023 @05:01AM (#36466226)
A Subconscious that doesn’t want to admit it, not every “good language” makes it to the next round
Re:Microsoft rewrote Q# compiler in Rust by Dudester230602 on Wednesday June 21, 2023 @06:14PM (#36425421)
While I admire it I most certainly do not desire it - like Haskell. I need to ship things, not figure out some borrow of a monad.
Re:Microsoft rewrote Q# compiler in Rust by bitwize on Wednesday June 21, 2023 @07:45PM (#36426332)
Languages with built-in checks for correctness, like type checking and borrow checking, help you ship software faster in the long run, cheaper, and with fewer bugs.
Re:Microsoft rewrote Q# compiler in Rust by HumblyTossed on Wednesday June 21, 2023 @05:35PM (#36424971)
I actually don't like Rust. It just doesn't fit me.

To each their own, I suppose.