Replies

This profile is from a federated server and may be incomplete. Browse more on the original instance.

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 (…)

zygoon,
@zygoon@fosstodon.org avatar

@mackuba but ioutil is deprecated :-)

juliank, to random
@juliank@mastodon.social avatar

How to render dependency graph as a graph, what are the understandable approaches there?

zygoon,
@zygoon@fosstodon.org avatar

@juliank I wanted to do something like that and realized that at the end of the day people handle lists better than graphs. I would render it as a list of direct and indirect dependencies. Graphs of even tiny size quickly render into illegible artwork. Unless you want to invest in a kick-ass layout, rendering and navigation widget, avoid graphs.

zygoon,
@zygoon@fosstodon.org avatar

@matk @juliank the problem with graphs is thatvyou need useful user interface for the worst case. Nail that before touching the easy cases. This is why I think lists are better for communication with humans.

juliank, to random
@juliank@mastodon.social avatar

Here is a comparison of the new apt(8) UX vs the classic apt-get(8) one for the install command.

Not duplicating the listing for dependencies means that despite having more padding (of sorts) it actually is comparable in length, but much more readable.

zygoon,
@zygoon@fosstodon.org avatar

@juliank I cannot wait for the "it breaks my workflow" bug that is inevitably coming.

pid_eins, to random
@pid_eins@mastodon.social avatar

This is such a bad bad API compat breakage:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e81cd5a983bb35dabd38ee472cf3fea1c63e0f23

It's used all over the place in userspace. In systemd we use it:

  1. to detect if a block device has partition scanning off or on
  2. In our udev test suite, to validate devices are in order
  3. udev rules use it for some feature checks (in older versions of systemd).

And it's even a frickin documented userspace API:

https://www.kernel.org/doc/html/v5.5/block/capability.html

So much about that nonsensical "we don't break userspace" kernel mantra.

zygoon,
@zygoon@fosstodon.org avatar
zygoon, to random
@zygoon@fosstodon.org avatar

The working branch of my userspace parser for binary profiles that are usually parsed by the kernel can now parse any profile I throw at it.

I don't do the DFA unpacking and analysis yet but given that I'm stuck at home (extreme allergy to whatever is in the air recently) I think I will get to that today.

I've been working on improving visibility into what apparmor_parser compiles by effectively de-compiling it back to human-readable data.

The code is up on
https://gitlab.com/zygoon/go-apparmor

zygoon,
@zygoon@fosstodon.org avatar

@roddhjav AppArmor has very little visibility into the userspace-kernel interface. The best you can do is run apparmor_parser with the dump option to see what the parser claims to do. The second problem is lack of up-to-date documentation that's readable and accessible.

The goals of the project are:

  1. Document the userspace-kernel interface in detail
  2. Provide a 2nd implementation (apart from the kernel) that reads binary profiles and displays them in human readable format for debugging
zygoon,
@zygoon@fosstodon.org avatar

@roddhjav apparmor has, sometimes, surprising semantics and as a part of figuring out where the problem lies, the text profile, the included base/abstractions, the compiler (aka parser) or the kernel, one has to figure what the binary profile actually says. Once that is demystified it is clear which side is wrong: userspace or the kernel.

drewdevault, to random
@drewdevault@fosstodon.org avatar

If you're asked to sign a CLA and/or copyright assignment before contributing to a FOSS project, refuse, and make a hard fork of the project instead.

Take direct action for free software.

zygoon,
@zygoon@fosstodon.org avatar

@drewdevault, how can a business close something that was not entirely owned? It cannot.

It must start with the same owner releasing something significant enough to warrant asymmetric contributions (small) from the wider community.

You can argue that over time, this is immoral, but the basic stance is too strong as the owner had every right to make that decision, and all the participants understood the deal.

zygoon,
@zygoon@fosstodon.org avatar

@drewdevault, but then you also say that all the contributors participated in immoral activity, and I think you can not make that claim for them without taking their agency away.

zygoon,
@zygoon@fosstodon.org avatar

@drewdevault I think I either don't understand something about your opinion or I can not make my opinion clearly enough.

I wish we lived in a world without CLAs...

zygoon,
@zygoon@fosstodon.org avatar

@drewdevault in your opinion, is that equally morally wrong as making proprietary software or is there a gradient there?

zygoon,
@zygoon@fosstodon.org avatar

@drewdevault right but I think this is related: the alternative to the copyleft+CLA is, in many cases, full proprietary.

I don't like it but I think it's in some ways better than not having the software in the public at all.

zygoon,
@zygoon@fosstodon.org avatar

@drewdevault wait, is it?

I don't get it, how can you equate that.

CLA is purely a business model. One of the very few in the FOSS world.

zygoon,
@zygoon@fosstodon.org avatar

@drewdevault no, it's really just a business model: someone hires a bunch of people to create some software and then releases that under *GPL + CLA hoping it gets popular and can be sold (either as a service or as license).

There's no moral part there yet, it's just a decision to operate in this specific way.

The moral decision is individual making the contribution. The rules are clear.

zygoon,
@zygoon@fosstodon.org avatar

@drewdevault the contributors are not ignorant and CHOOSE to play along.

They could have forked but didn't.

The non-free angle is entirely up in the air: it's possible, I totally agree on that but it's not guaranteed. Only certain types of software is susceptible to being closed as a SAAS.

GNU requires CLA for entirely different reasons but it's (more or less) clear why they do that.

In both cases the contributor chooses to contribute under the rules set out by the project or fork or not.

  • 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