bentsukun, to random
@bentsukun@mastodon.sdf.org avatar

Two new versions released with security fixes, 1.22.3 and 1.21.10. Already available in HEAD!

Wisesnail, to goodomens
@Wisesnail@mastodon.social avatar
TehPenguin, to rust
@TehPenguin@hachyderm.io avatar

When posting your programming language comparison article, can you please include the context of your comparison?

"Rust vs Python, which is better? "
"Sir, this is a kernel"

"Why I switched from C++ to Go"
Taps sign: "No GC or green threads in the kernel"

Sincerely, a systems dev who'd like to remind you that APIs existed before REST...

hynek, to random
@hynek@mastodon.social avatar
sirber, to Laravel
@sirber@fosstodon.org avatar

#Laravel / Eloquent looks way easier than #nestjs / typeorm and #go / #gin / #gorm 😅

#php #webdev

leanpub, to ComputerScience
@leanpub@mastodon.social avatar

Build Your Own Database From Scratch by build-your-own.org is on sale on Leanpub! Its suggested price is $29.00; get it for $19.75 with this coupon: https://leanpub.com/sh/GVNwqXYy

EricMesa, to golang

A few thoughts on Programming languages

Just a few thoughts on programming languages that have been rattling around in my head this week, but which don’t each merit a full blog post. The main theme is that the culture behind each programming language leads to some interesting choices, as is the case with spoken languages.

This week I started learning how to program in Rust. Even though I’m using the project-based Command-Line Rust to learn, the author still went with the traditional “Hello, world!” project for the first intro to the language. I was also working on a Go project last week and so it immediately stood out to me that (at least as taught by this author) Rust has the print! macro that allows you to succinctly print to the command line. By contrast, Go requires importing fmt before you can print. This was the first topic that was swirling around in my head this week. What makes language designers choose whether printing output (one of the most basic things a program can do) is built-in or requires an import. I even remember back when I was learning Java in undergrad (I think it was Java 1.8, but I don’t remember) we had to use the savitch library just to get program input (another very basic computer program concept). As I thought about it, I wondered if it has to do with thoughts around compilation and whether the language designers think you’re mostly making user-interactive programs or libraries? It makes sense to me that scripting languages like Python, Ruby, and Perl would have print built-in since you always have to have the interpreter along with you, so all the basics should be there. (The original Batteries Included Python promise, for example) But perhaps the Go developers thought you wouldn’t always be printing to the command line so a more efficient binary could be compiled by forcing you to import the functionality? I’m not entirely sure.

The next thing I started thinking about, again due to learning Rust, was the mutability of variables. In most languages I’ve come across (I think all, except Haskell) all variables are mutable by default. It almost seems pointless to have a non-mutable variable. I understand why many languages have the concept of a “contanst” modifier/keyword. Unlike normal variables, THIS ONE does not change. But the opposite seems so weird since most of what we often do in programming involves changing the value in a variable. Perhaps as I learn more about Rust, I’ll understand their reasoning, but this seems completely backwards to me.

Both Rust and Golang use structs to organize variables where Ruby, Python, and Java use objects. But when both Go and Rust allow you to “attach” methods/functions to structs – is there a true distinction between object-oriented programming and struct-based programming? It seems like it’s just semantics (in the generic sense of the word) – at least at the level at which I program. The only difference I can see is that structs don’t have inheritance, although Go’s “types” solve some of the same problems.

Today’s (the day I’m writing this, not the day it’s going to be posted) shower thought was about programming language versions. On one end you have Java (I think now on version 22) and C# (now at version 12). On the other you have Python and Ruby (both at version 3). Perl essentially stopped at 5 with Perl 6 evolving into Raku. I don’t know what Java is up to. But I think C# is actually using the versions correctly – I’ve heard that each version introduces completely different ways of doing things and that the way you program C# depends strongly on when you jumped in. This is why Python is probably never moving to v4 unless they need to make some kind of huge change. Rust is an outlier with year-based versions. I guess that’s fine, but doesn’t tell you anything like a proper semantic versioning could.

Finally, I know that Rust is the newest of all the programming languages I’ve learned, but I really love how new projects are started. Python isn’t horrible, but it’s currently suffering from a lots of ideas, none of which has complete market share. You could do a simple virtual environment or you could do a more complex virtual environment/lock file situation with Poetry. (And there are about another half dozen variations on these two themes) But Rust….Rust deserves a chef’s kiss. When you start a new project with “cargo new project-name”, not only does it set up your directory structure, but it does a whole bunch of great setup tasks. It creates your Cargo.toml file (with Python, which only really started supporting toml files at the project level a few years ago, you need to look at documentation to figure out what goes in there) so that you have all the basics in there already. But it doesn’t stop there! It also, in a nod to modern programming, creates a git repository AND a gitignore file. It’s a thing of beauty. I would absolutely love for Python to move in this direction officially (not through a random user choice) for their defaults. Even “go mod init” could benefit from setting up a git repo and a git ignore (since the toml is not how Go works – I think they would probably best set up a README.md since Go’s default packaging is through git repos).

https://wp.me/p5cs3g-4HT

leanpub, to devops
@leanpub@mastodon.social avatar

Network Automation Crash Course https://leanpub.com/b/networkautomationcrashcourse by GitforGits | Asian Publishing House is the featured bundle on the Leanpub homepage! https://leanpub.com

stefano, to golang
@stefano@bsd.cafe avatar

Interesting reading: Go performance from version 1.0 to 1.22

https://benhoyt.com/writings/go-version-performance-2024/

kowalabearhugs, to rust
@kowalabearhugs@mstdn.social avatar

Calling all #Solidity #Rust #Go #PHP #TypeScript hackers, apply for the 1st ever #Monero Hackathon.. https://monerokon.devfolio.co

  • Free entry to #MoneroKon2024 🎟️
  • Free food & drinks 🥪🍻☕️
  • Hackers can crash overnight @ Paralelni Polis 😴
  • $6k+ in prizes & bounties 🏆 including a 2000 USD paid in XMR award from the MAGIC Monero Fund (subject to increase)
  • max: 100 ppl.

https://monerokon.devfolio.co/

leanpub, to ComputerScience
@leanpub@mastodon.social avatar

Build Your Own Database From Scratch by build-your-own.org is on sale on Leanpub! Its suggested price is $29.00; get it for $19.75 with this coupon: https://leanpub.com/sh/BjexLW1x

dusnm, to random
@dusnm@fosstodon.org avatar

People complain too much about error handling in . Like it or not, go treats errors like any other value. Since the compiler forces you to use all return values of functions, unless you specifically discard the error, you're always aware of which functions can error and that goes a long way to improve the reliability of your software.

Java has checked exceptions, JavaScript trusts you to know that a function 20 slots down the call stack has an unhandled error.

83r71n, to Cybersecurity
@83r71n@ioc.exchange avatar

A critical vulnerability, named BatBadBut, was discovered in the Rust programming language, affecting not just Rust but also Erlang, Go, Python, Ruby, and potentially others. This vulnerability, with a severity score of 10/10, could allow attackers to execute arbitrary commands on Windows systems by exploiting how Rust handles batch files. The issue arises from Rust's standard library improperly escaping arguments when invoking batch files on Windows, leading to potential command injection. The vulnerability has been addressed with a fix in Rust version 1.77.2, which developers are urged to update to. Other programming languages and systems, including Node.js, PHP, and Java, are also affected and are working on patches.

https://flatt.tech/research/posts/batbadbut-you-cant-securely-execute-commands-on-windows/

https://blog.rust-lang.org/2024/04/09/cve-2024-24576.html

cuddle, to random
@cuddle@bsd.cafe avatar

There are just too many "problems" with C++. I wish modern C++ was something back in the day, so we won't have to suffer.

Libraries still uses iostream to display in stdout/stderr and it's certainly not my favorite. It's slow, bloated, and isn't even describable.

e.g.
std::cout << a.x << " " << a.y << " " << a.z << '\n';
vs
std::println("{} {} {}", a.x, a.y, a.z);

And here we come, standard of string

why:
std::string a = "Hello world";
if (a.find('r') != std::string::npos)
fmt::println("{}", pos);
else
fmt::println("not found");

and why not:
std::string a = "Hello world";
if (a.contains('r')) // Do member function overloading in the class
fmt::println("{}", pos);
else
fmt::println("not found");

why standard doesn't implement trimming functions for white spaces? why do I always have to rely on iterators for such things... (it's just feels like I've to type too much for a basic functionality)

and there's more but let's keep this post small.

jhx,
@jhx@bsd.cafe avatar

@cuddle
Sometimes when I need a break I go over and code something small with
It is quite relaxing to do something in much less lines of code.
I love C in generel - the simplicity is divine.
Just sometimes one needs a break 🙂
I lack C++ experience... the small things I do on C++ does not make me competent to give any kind of experience.

Chewing away on code can be daunting, that is for sure.

Maybe you need a break from C++ @cuddle ? 🙂

thejapantimes, to business
@thejapantimes@mastodon.social avatar

Private drivers with their own vehicles can now be hailed for rides in Tokyo, marking the first time in Japan that ride-hailing has been put into practice after the system was introduced on April 1. https://www.japantimes.co.jp/business/2024/04/08/tech/tokyo-ride-hailing/

leanpub, to ComputerScience
@leanpub@mastodon.social avatar

Build Your Own Database From Scratch: Persistence, Indexing, Concurrency https://leanpub.com/build_your_own_database_from_scratch by build-your-own.org is the featured book on the Leanpub homepage! https://leanpub.com #ComputerProgramming #Databases #Go #SoftwareArchitecture #ComputerScience

purelinux, to golang German
@purelinux@social.tchncs.de avatar

Whats your favorite ? And why?

Wisesnail, to goodomens
@Wisesnail@mastodon.social avatar

I can relate, ... I really can! 🙈

I hope you like it 💙

alyx, to golang
@alyx@3615.computer avatar

What’s your favorite library in for web authentication? Or any other recommendation to implement it (like std lib or just a JWT one etc).

Ideally it supports classic credentials, 2FA and passkeys. Bonus for OAuth providers that you can extend (if it does not support Mastodon out of the box for example).

Reboost welcome 👉👈

billy, to rust
@billy@fosstodon.org avatar

Is there a language like (compiles to native binary, preferably without GC or manual memory management, has an easy-to-use build system) that also doesn't end up pulling in hundreds of transitive dependencies? Ideally what I'd want is like Rust but with 's standard library, capable of handling most basic tasks (even if external dependencies would make life easier). I often look at but I don't want to tangle myself up with Google anymore than I already have

AndriiKuznietsov75, to Java Ukrainian
@AndriiKuznietsov75@social.kyiv.dcomm.net.ua avatar

Як працюють компіляція та виконання коду👇
🔸Компілювані мови (#C, C++, )
Вихідний код перетворюється компілятором на машинний. Машинний код виконується безпосередньо процесором.
🔸Байт-код (, C#)
Вихідний код компілюється у байт-код, а потім JVM виконує програму. Іноді JIT-компілятор компілює вихідний код у машинний, щоб прискорити виконання.
🔸Інтерпретовані мови (, , )
Тут для виконання програми не потрібен машинний код, натомість програму рядково виконають інтерпретатори.

video/mp4

thejapantimes, to business
@thejapantimes@mastodon.social avatar

Japan has begun the slow rollout of ride-hailing services provided by private drivers through apps such as Uber and Go, almost a decade after other countries introduced them. Here's how it works. https://www.japantimes.co.jp/business/2024/04/02/ride-share-explainer/

leanpub, to ComputerScience
@leanpub@mastodon.social avatar

Build Your Own Database From Scratch by build-your-own.org is on sale on Leanpub! Its suggested price is $29.00; get it for $19.75 with this coupon: https://leanpub.com/sh/X7ZbTCdt

ascherbaum, to PostgreSQL
@ascherbaum@mastodon.social avatar

PGXN v2: in or in ? Details in the article, vote now.

https://justatheory.com/2024/03/pgxn-language-choices/

rgacogne, to random
@rgacogne@mamot.fr avatar

Do I have a great developer looking for a job in my contacts?

We at PowerDNS are hiring, remote is not a problem (most of us are remotely working from various places in the EU at the moment): https://careers.open-xchange.com/job/The-Hague-Senior-Software-Developer-PowerDNS-%28Go%29-%28mfd%29/973784855/

  • All
  • Subscribed
  • Moderated
  • Favorites
  • anitta
  • mdbf
  • magazineikmin
  • InstantRegret
  • hgfsjryuu7
  • Durango
  • Youngstown
  • slotface
  • everett
  • thenastyranch
  • rosin
  • kavyap
  • khanakhh
  • PowerRangers
  • Leos
  • DreamBathrooms
  • vwfavf
  • ethstaker
  • tacticalgear
  • cubers
  • ngwrru68w68
  • modclub
  • cisconetworking
  • osvaldo12
  • GTA5RPClips
  • normalnudes
  • tester
  • provamag3
  • All magazines