Forgot your password?
typodupeerror

Comment Re:As s human the weakness of Rust is macros (Score 1) 24

After spending several weeks using Rust, I went back to Go.

I wish Go had some of the simple ergonomics of Rust:

  • - The ability to redefine a new variable with the same name as another variable that you no longer need (shadowing it). Go does not allow this: x := strconv.Itoa(x), but Rust allows the equivalent.
  • - The ? operator for propagating errors explicitly, with just one symbol, instead of adding this after every function call: if err != nil { return err }. The ? operator would be even easier to use in Go, because Go has a universally used garbage-collected error interface, while Rust does not, and needs conversions from one error type to another.
  • - The ability to add methods to any class, without modifying the class or adding a wrapper class. You just define the extra methods in a package (crate, whatever), and by importing the package, you have access to these methods.
  • - The Result construct is self-documenting vs a Go function that returns (T, error), where it really returns either T or an error, not both.

More positives of Rust:

  • - The type system is very well thought out, for example enum, Result, Option. It codifies the programmer's intentions in code rather than using assumptions everywhere that are either documented in comments, or not at all (If the result is nil, then the error is not nil, and vice versa).
  • - Macros are tedious to write, but very powerful, once you start using them.

The advantages of Go:

  • - Lots of easy to use libraries, many of them in the standard library (for example net/http).
  • - built-in reflection that makes it easy to use Go objects with text formats e.g. using text/template, or html/template, encoding/json, etc. Can Rust do this? Perhaps, but only if you manage to write or find complicated macros (e.g. serde) and use them for each class you want to reflect on. Last I checked, serde yaml was unmaintained, while one can find several yaml implementations for Go, none of which requires adding a macro to each class you want to marshal/unmarshal.

Problematic things in Rust

  • - In order to do async I/O like networking, you have to use async methods allover the place. This was a deal-breaker for me. I painstakingly wrote macros for a command-line interface framework, but when I wanted to do some networking, I realized my command-line mechanism would not work, because it did not call methods with async.
  • - Sharing data like simple strings in data structures is often difficult.

Comment Use more meaningful rankings (Score 2) 24

Rather than discussing some fuzzy Tiobe algorithm that uses everything except actual code measurements, how about using real data from code repositories like github octoverse.

Real data says that the most popular language is TypeScript, not Python, ranked by monthly contributors. In other words, more people commit TypeScript code to github than Python code, measured monthly.

Comment Re:I find Claude quite helpful (Score 1) 24

I installed Claude Code in an Incus container, which I use only for Claude. I use it from working project directories that are separate from my code repositories. If I give it read-only access (no push) to any git repos that I want it to work on, I put them outside of the Claude project directories. I sometimes give it ssh access to other systems to look at and diagnose problems, but they are test systems or clones that I eventually discard after Claude logs in to them.

Comment Re:use it to vote? (Score 2) 124

I would refrain from calling it "unhackable". How do you prevent stolen credentials? And how would you prevent double-voting? You can ignore second votes, but they can still flood the blockchain and make it difficult to audit. Wouldn't it be vulnerable to DDOS attacks?

Comment Re:Extraordinary claims require extraordinary evid (Score 1) 105

How will AI kill us all, exactly?

It does not need to build weapons. It can do a lot of damage by hacking and controlling computers and manipulating information. It may manipulate people into doing the damage. We are already relying unnervingly on information we receive from the internet, which we must somehow judge as reliable or "fake news". How do we know which information is true and which is false? This is not a far-away future scenario. Current policies about climate change are determined by what people "believe".

It might hack military systems and make a nuclear power believe that it is under nuclear attack. It can create enormous chaos by hacking and disrupting almost any computer. It doesn't even need to "want" to do any damage. You may ask your super-intelligent AI assistant to help you find money to pay your bills, and it may do so by hacking a bank, or by convincing an unsuspecting person to send you money, or by spreading rumors which cause a financial crash which benefits you.

Comment Re:Automattic and WP Engine now have the same prob (Score 1) 38

code that is long gone because Drupal is now Symfony-based and the way you do basically everything has changed since I knew how to do anything meaningful, back in version 7 or so.

Breaking backward compatibility was Drupal's fatal flaw. Not only are old modules incompatible with new versions, the core database needs a migration to go to the next version after D7, and Drupal does not provide this migration.

Comment Wrong link (Score 2) 111

The summary links to the wrong place on Gates' blog. Here is the correct one. But the pages are all mixed together so that as you scroll down you get to a different topic and the url changes.

A good limit on AI development would be to allow it to grow only with renewable power, so that it does not accelerate climate change. If you scroll down Gates blog, you'll see his thoughts on climate change. But there is no mention of it in "The choices we make about AI" essays. As if the world's problems are unrelated to each other.

Slashdot Top Deals

You know that feeling when you're leaning back on a stool and it starts to tip over? Well, that's how I feel all the time. -- Steven Wright

Working...