@JamesWidman@mastodon.social

JamesWidman

@JamesWidman@mastodon.social

We could probably do better.

he/him or they/them

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

wolfpld, to random
@wolfpld@mastodon.gamedev.place avatar

Why is clang taking 5 minutes to compile a relatively small C++ (168 KB) source file? Let's see...

https://github.com/ggerganov/llama.cpp/blob/917dc8cfa67a72fb7c8bf7392270da3bf4833af4/unicode-data.cpp

Ah, oh, um... That's not how you do it.

Here's 10 MB of data as source code that compiles in about 8 seconds:

https://raw.githubusercontent.com/wolfpld/tracy/8983e14e1875ea1b7de820c558f898f3ad47015a/profiler/src/profiler/TracyMicroArchitecture.cpp

JamesWidman,

@wolfpld fwiw:
https://github.com/llvm/llvm-project/pull/68620

i have not looked at that thread since october, but recent posts seem to indicate progress, so it should be nice when it's finally merged

JamesWidman,

@wolfpld but for including binary data; like, when this PR is merged, you could dump your result of preprocessing to a file foo.bin and then "foo.bin"

(and there should be a nice reduction in build time there)

whitequark, to random
@whitequark@mastodon.social avatar

me: "i like it how the entire LLVM project is one monorepo"
her: "when are you going to compile the entirety of LLVM to WebAssembly?"
me: "yes."
her: "... I said that as a joke"

JamesWidman,

@whitequark this seems... unusually long...?

have you tried lld or mold (https://github.com/rui314/mold)?

(admittedly, i haven't linked clang in the past couple of months)

JamesWidman,

@whitequark oh wow...

i'm wondering if the time consumed by the linker is somehow a wasm-specific thing?

how long does linking take if you build a version of clang for the native CPU arch?

nocontexttrek, to StarTrek
@nocontexttrek@mastodon.social avatar
JamesWidman,

@nocontexttrek i thought that was supposed to be a greenish tint rather than yellow? (because vulcan blood carries oxygen with an analog to hemoglobin that uses copper rather than iron, and copper oxidizes green whereas iron oxidizes red, so whereas a pale-skinned human gets red in the face, a pale-skinned vulcan would get green in the face)

JamesWidman, to random

status: feeling annoyed that programmers messed up the definition of "dependency".

in the phrase "X depends on Y", the dependency* is X, but programmers decided the dependency is Y.

[*] also called the dependant or dependent

JamesWidman,

gonna start using "dependent" since we haven't botched that yet.

also: gonna start using "requisite" where programmers use "dependency".

so if X depends on Y, then X is a dependent of Y, and Y is a requisite of X.

JamesWidman, to random

take of unknown temperature: the concept of an search path (-Ifoo -Ibar ...) that names all header directories of all the libraries you use, all of which may be searched in each individual directive, was a mistake.

in nearly all cases in C/C++, when you include a header (or, in other languages, when you import a module), there is exactly one directory that you want that header to be found in, and so you want it to match with exactly one -I option.

JamesWidman,

so what you really wanted was:

  1. the ability to reference a directory-parameter as in:

"$foo/a.h"

and

  1. for the compiler to check that the argument for that parameter was given on the command line, as in:

% clang++ -I?foo=/path/to/foo

or even:

% clang++ -I?=/path/to/foo
(where the name of the dir-param is given by the last component of the path, which in this case is "foo".)

and the compiler could give a nice diagnostic if there is no -I? option for a given dir-param.

JamesWidman,

as a side benefit, this may also speed up the scan-deps phase slightly, since it's no longer necessary to call stat()/open() more than once when an is processed

JamesWidman,

this would make some traditional includes more verbose tho, as in:

<$std/stdio.h>

but in new languages, you could specify that the first component in an import is a declRef of a directory-parameter:

import std.io; // uses directory-parameter std

import std; // imports all files under the directory for std (which is implicitly defined by default)

JamesWidman,

second thought: if we had this in the C/C++ preprocessor, we wouldn't necessarily need "" or <>, since those are traditionally used to indicate how the compiler searches for the file (and since a use of a directory parameter indicates that only that one directory is searched, we usually wouldn't need any delimiters unless there's a space or something in the filename), so we could have:

std/io.h // uses directory parameter std; equivalent to
std/"io.h"

JamesWidman,

in the (probably?) less-common case where you really want more than one directory to be searched for a given include/import, we could have a separate option for that:

clang++ '--search-path?foo=/d1:/d2'

then:

foo/a.h

would make the compiler search for a.h in /d1 and in /d2 (and not in any other directory).

JamesWidman,

cc @dgregor79 and @chandlerc because if there are codebases where directory-parameters (as described up-thread) wouldn't work, you've probably seen them. (And if directory parameters wouldn't actually help much, you both probably have a good handle on that too.)

JamesWidman,

@chandlerc @dgregor79 ah crap, i didn't even think of transitive includes & the inevitable namespace-clashing...

thanks!

aeva, to random
@aeva@mastodon.gamedev.place avatar

The Leaving Rust Gamedev article resonates with most of the frustrations I've had working on the internals of Tangerine (C++) since I converted it from being largely single threaded spaghetti to aggressively concurrent spaghetti, and that's making me think maybe I'd have a better time if I picked a different language for the hot paths, because necessary non-compulsory refactoring also kills iteration time.

I just don't know what though, because nothing ever seems to fit the bill of what I need.

JamesWidman,

@aeva @aud re vectorizing, i think that's spelled 'foreach':
https://chapel-lang.org/docs/primers/loops.html#foreach-loops

it's neat how they let you refer to an entire array in an arithmetic expression (A rather than A[i]), & that implicitly translates to a reference to some chunk of the array (which will be a single element in a (non-multithread, non-vectorized) for, and a reference to a SIMD vector of elements in a foreach, which is why you can make it more parallel by changing that one keyword).

https://chapel-lang.org/docs/primers/loops.html#foreach-loops

JamesWidman,

@aeva @lesley on one hand i'm really glad that LLVM exists; on the other hand, the cost of codegen seems to have gone way up over the past couple/few decades, to the point that i wonder how many projects have been abandoned, as a consequence of long build times, before they could ship

fanf, to random
@fanf@mendeddrum.org avatar

2021 retro-link! https://github.com/arnoldrobbins/cstr100 - Why Pascal is Not My Favorite Programming Language. (troff source)

JamesWidman,

@aminom @rygorous @pervognsen @fanf ooooh, nice.

over the weekend, after reading that rust-gamedev post, i was thinking it would be nice to find one or more compiled languages that are a better fit for rapid prototyping, thought of TP, and then downloaded the current installer for Delphi. And that's when i found out that they do not support macOS as a host platform (so i can't use it).

so it's great that we can just load TP up in a browser like this!

JamesWidman,

@aminom @rygorous @pervognsen @fanf can anyone recommend any Turbo Pascal books and/or magazine articles from the 80's (the ones that would give you code examples to type in by hand)?

JamesWidman, to random

"no politics at work" is such a questionable policy just on the face of it.

your personal politics determine the set of problems you would even want to solve in the first place.

so it seems like "no politics at work" really means "no politics at work except the politics approved by shareholders". And that would at least be coherent (though morally objectionable in this case), but apparently google's shareholders' politics prevent that level of candor.
https://www.washingtonpost.com/technology/2024/04/22/google-nimbus-israel-protest-fired-workers

JamesWidman,

so at this point it seems fair to ask how far google's shareholders will go in aiding & abetting genocide.

would they choose to participate in the killing of half of all Palestinians forced out of Gaza?
80%?
100%?

we don't know, because (apparently) they like to be very tight-lipped about their politics.

JamesWidman,

Do Sergey and Larry even recognize that Palestinian people are fully human?

Last year, the question would have been uncalled for, but now, maybe the more cautious assumption is that they don't.

pervognsen, to random
@pervognsen@mastodon.social avatar

Finally got so fed up with Windows that I installed Arch on my laptop (without the help of archinstall so it was a good learning experience). Gotta say, KDE Plasma 6 has blown me away. A few annoying defaults I had to change (e.g. floating panels as a default) but such a great experience coming from Windows 11: https://kde.org/announcements/megarelease/6/

JamesWidman,

@pervognsen
> devoid of ads

just incredible that this has become a selling point

thephd, to random
@thephd@pony.social avatar

Working on C is kind of depressing.

JamesWidman,

@thephd do you ever think about starting to train up people* to eventually take over?

[*] i intentionally mean "the plural of 'person'"

mekkaokereke, to random
@mekkaokereke@hachyderm.io avatar

Honest question for white people that don't consider themselves racist:

White nationalists have been vocal about their attacks on DEI. These are literally the same people that talk about Charlottesville, Jan 6th, and ethnic cleansing.

They've laid out exactly how they plan to destroy DEI.

  1. Make false claims that DEI is about giving unqualified Black people an unfair advantage

  2. Work with racist politicians to use this as a pretext to make all DEI programs illegal.

1/n

JamesWidman,

@mekkaokereke

> They've laid out exactly how they plan to destroy DEI.

I've seen a few posts mentioning DEI lately, but i regret that i have been completely oblivious of the fact that there was a planned/deliberate disinformation campaign.

Is there a wiki article about it somewhere with links to sources? (if not, it seems like there should be...?)

  • 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