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...

mackuba, to ruby
@mackuba@martianbase.net avatar

Current status: I opened about 100 links to articles and threads from Google results comparing #ruby, #golang and #rustlang and I'm planning to read them 🫠

(no, I'm not really considering Go, mostly just trying to convince myself that I'm not making a mistake starting to learn Rust and not Go 🦀😛)

mackuba, to golang
@mackuba@martianbase.net avatar

It's insane that I can have a conversation with this thing and in a few moments and a few back and forths build a working program in a language I know nothing about (I don't know Go)… don't tell me this isn't huge 😳

You: One modification - this current code counts all matches of all regexps against the text. So if one line of text matches two or more regexps, it will be counted as 2 or more. I want a given line of text to only be counted once if it matches
You: What's the command to compile this to a binary? ChatGPT: To compile a Go program to a binary, you can use the go build command followed by the name of the Go file you want to compile. If you want to specify the output binary name, you can use the -o flag followed by the desired name. Assuming your Go file is named main.go, you can compile it to a binary named my_program like this: You: Looks like
You: Great, that works 👍 Is there some way to compile this program in "release mode", with a more optimized version or something? ChatGPT: Yes, you can compile your Go program in release mode with optimizations using the go build command with the -ldflags flag set to -s -w, and the -trimpath flag set to remove the build path from the resulting binary. Here's the command to compile your program in release mode: You: I mean, not optimizations for binary size, but optimizations to make it faster? ChatGPT: Ah, I see! In Go, optimization for speed primarily comes from the compiler's default optimizations, and there isn't a direct flag to enable additional optimizations beyond what the compiler already does. However, there are some general principles you can follow to improve the performance of your Go program: Profiling: Use Go's profiling tools (go test -cpuprofile, go tool pprof, etc.) to identify bottlenecks in your code and optimize them. Profiling helps you understand (…)

publicvoit, to programming
@publicvoit@graz.social avatar

What happens, when you join two paths in a language when the second one is an absolute one?

join("foo", "/bar")
returns "foo/bar" or "/bar"?

The wonderful @meisterluk wrote a great article about that you might want to read: https://lukas-prokop.at/articles/2024-05-03-filepath-join-behavior

I can not tell what version I'd actually prefer. There are situations where both versions would be "proper".

#C++

changelog, to opensource
@changelog@changelog.social avatar

🦾 New Changelog & Friends!

Our friend @deadprogram joins @jerod & @adam to discuss:

🎈 high-altitude weather balloons
🧑‍🚀 Human life on Mars
🤔 Zeno’s paradox applied to ML
🎶 open source the Wu-Tang way
➕ and much more!

This is a good one, enjoy! https://changelog.com/friends/42

#opensource #golang #ai #wutang #podcast

markus, to golang
@markus@hachyderm.io avatar

I released a new version of my module for persistent message queues based on today. I added a basic job runner, since that’s one of the things I most use a queue for. Check it out at https://www.goqite.com

ferki, to gentoo
@ferki@fosstodon.org avatar

I'm going to host an online workshop for the Gentoo e.V. on 2024-06-15 about how to "Host Gentoo dependency tarballs as GitHub releases".

I'll show how to use GitHub for dependency tarballs as an external #Gentoo #contributor, such as a proxied maintainer, a GURU committer, or an overlay #maintainer.

I use this approach to package #opensource #Golang software, and it can be applied to other similar situations, or even automated through local scripts or GitHub Actions.

https://gentoo-ev.org/news/online-workshops-2024/

preslavrachev, (edited ) to programming
@preslavrachev@mastodon.social avatar

One more time, I've made my way to the Golang Weekly newsletter! Thanks for featurng my random ramblings on Go 🙏

https://golangweekly.com/issues/505


#newsletter #programming #golang

fallenhitokiri, to golang
@fallenhitokiri@social.screamingatmyscreen.com avatar

Bubble Tea for #golang is the first TUI library I touched that doesn’t make me regret writing a TUI.

The examples, documentation and video tutorials also make it super easy to get started or stitch together the parts you need.

Overall this is just a really good library from a developer perspective.

rsc, to golang
@rsc@hachyderm.io avatar

“Evolving the Go Standard Library with math/rand/v2” #golang
https://go.dev/blog/randv2

vascorsd, to programming
@vascorsd@mastodon.social avatar

Borgo Programming Language
https://borgo-lang.github.io/

Borgo is a new programming language that compiles to Go.

#programming #programminglanguages #golang #borgolang

Ant8e, to golang
@Ant8e@fosstodon.org avatar

Probably what go should have been in the first place

https://borgo-lang.github.io/#intro

guardianproject, to golang

#golang's core crypto/tls library merged client #ECH support! It should be included in the Go v1.23 release. Server-side support is still in the works.

https://go-review.googlesource.com/c/go/+/578575

#EncryptedClientHello

sirber, to Laravel
@sirber@fosstodon.org avatar

/ Eloquent looks way easier than / typeorm and / / 😅

sirber,
@sirber@fosstodon.org avatar

@Crell In #golang, I would just mock the repository layer and do no db calls 😅

alyx, to golang
@alyx@3615.computer avatar

I'd like to find more YouTube channels about software development / engineering / etc but it's like 98% of the same white guy, screaming like a twitch streamer, making almost every video about "this is X killer" "why you should NEVER do that" or "your IDE is shit use X instead". Of course they talk like they are the thing and it's the only truth.

Any recommendations? interested in or anything related

preslavrachev, to programming
@preslavrachev@mastodon.social avatar

How long, before Google ditches the Go team too, and what would that mean for its future adoption?

https://simonwillison.net/2024/Apr/27/everything-googles-python-team-were-responsible-for/


#programming #golang #python #google

wilson, to golang

This weekend, I hacked together a markdown documentation generator for Postgres in Go. It should be extensible to other databases, as well as including other properties from database.

It's called SQLDoc — please check it out!

https://husin.dev/sqldoc/

sirber, to python
@sirber@fosstodon.org avatar

I think it's better to learn than catch up on ? 🤔

sirber,
@sirber@fosstodon.org avatar

It's sad that I see almost no job in #golang.

mid_kid, to golang
@mid_kid@fosstodon.org avatar

Downloading 300MB+ of #golang dependencies for a single program like disk space don't matter 😎

#gentoo #gnu #linux

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).

#Go #Golang #perl #python #Ruby #rust

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

fireflyzero, to webassembly
@fireflyzero@fosstodon.org avatar

Hello World! Firefly Zero is an in-development handheld game console that runs and supports multiplayer. It is written by @orsinium in , runs on , and will be fully open source (both software and hardware).

We already have a working desktop emulator and are getting a Rust and SDK ready for alpha testing. Sounds fun? Stay tuned!

Website:
https://fireflyzero.com/

:
https://gram.social/firefly

alrs, to golang
@alrs@lsngl.us avatar
nixCraft, to random
@nixCraft@mastodon.social avatar

yyyy-MM-dd

dominjaniec,
@dominjaniec@pol.social avatar

@nixCraft recently, I've learnt how one defines date-time format in #GoLang - to have that great date format, one need to use a horrible thing, exactly like:

> time.Now().Format("2006-01-02"))

ainmosni, to Podcast
@ainmosni@berlin.social avatar

Listening to a about in , and it’s quite interesting. One bonus is that one of the guests has the most Italian accent I’ve ever heard, which makes it fun to listen to him speak.

jaycruz, to rust
@jaycruz@fosstodon.org avatar

This is a 48 minute long article that's critical of the Rust hype train vs C/C++. The TLDR is that while security is a problem, the Rust vs C choice as the only choice for low-level systems programming is a “non choice”. The author states that Go is a perfectly fine choice. https://medium.com/

#c

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