#🤖│community_dev
1 messages · Page 6 of 1
We may be able to help each other 
vpn as in actual network, not just a proxy
@floral crane thanks for helping with this
synchronization is bad because I had to play the video and run the command at the same time
the flickering is not visible to my eyes, so may be camera things
arent they like 700-900usd a year basically
Pretty neat
Windscribe is a VPN, it has desktop programs, browser extensions, other various things like OpenWRT, support OpenVPN, and WireGuard. but I don't know what Talescale is
idk, but they do require a legal entity with like proper registration papers and shit
tailscale is an overlay network to connect devices together
basically, a company that is registered in a proper company register
the clients for linux are open source and there's an open source server reimplementation, but the official one is free for 100 devices so that's fine too
otherwise you can't get a code signing cert as far as I understand it
so just setup one up
everything is lol
basically, I can type my server's hostname from my phone or laptop and it will just work, tailscale will connect them either directly if it can or via one of their proxy servers, but the traffic is not metered and they can't see it as it's built on wireguard
i thought tailscale is just a vpn
well, yeah
wireguard is also just a vpn
that's what VPNs were used before everyone started the whole vpn = privacy proxy thing
So, tailscale is just STUN/TURN as a service? lol
basically yeah
just that it's not a hassle to always setup
really just a convenience service, but their free tier is basically always free for personal use, they're making money off companies
only vpn i ever had was my router as vpn so i can just sit in my home network when needed
yeah
not like i needed it
but I can also connect to my VPS, home server, etc from phone from anywhere without having to set up ip addresses etc
also used to connect to my laptop from phone when I needed to remote into it, when both were off my home network
also they have really nice blog posts
Hmm vmware doesn't let me pass in my keyboard... I guess I'm trying virtualbox or hyper-v
Yes it does, under removable devices
keyboard doesn't show up for me, just everything else
Weird
Virtualbox is so much slower... insane, but it shows my keyboard
TIL Appimages require libfuse2 which isn't pre-installed on Ubuntu
You also have to run the appimage with sudo and --no-sandbox for the automatic udev rule creation
and virtualbox fails to pass through my keyboard... lets try hyper-v
I found a setting to show all usb devices in vmware, and virtualbox requires disabling hyper-v, windows sandbox, device core isolation integrity, turning off any wsl 2 instances, and hyperv bcd boot setting thing. otherwise it uses software virtualization which is slow, but doesn't say that anywhere.
Actually, it looks like VirtualBox is not compatible with WSL2 anymore because WSL2 requires the hypervisor launch type BCD setting to be auto now, not off... so VirtualBox is out on a Windows host, VMware only.
I finally got a vm to work and pass through my keyboard (vmware), but the automatic udev rule creation requires sudo/root but running the appimage with sudo/root causes a white screen. Maybe wootility could use pam/polkit thing to ask for privileges
I created the udev rules myself on my VM
I don't think they are the issue, since your lib doesn't recognise the devices even with them installed
Try the clib directly, but yeah it's weird that the same library doesn't return the same results..
I don't understand Rust well enough to understand the semantics of using this "dynamic link library", because by all known laws of dynamic linkers, this program should not start at all.
Maybe that lib is installed statically, or via GH?
What would seem to be the issue here?
a library used from rust that should be dynamically loaded is not working, yet using that same library directly from rust works
which is really great explanation I know
there's a wrapper rust library around a C library, that C library works even when used from rust, but that wrapper library doesn't
yet it doesn't error out and works on windows
So this is using a library as a crate vs a DLL
yeah
it should be the same version though, as shay maintains both the library on AUR (which works) and the crate (which does not)
Weird, I don't have enough information to make a guess as to what's actually happening though
I'm not really sure why it doesn't work either, I thought it might be libusb/hidraw/hidapi related but trying the system libusb or hidraw with the env instead of having it build from source doesn't make a difference
It's strange especially when it works on windows (and I think mac, I think Tony tested WPS on mac)
The AUR package is a version behind from the crate because it builds from source, but shouldn't matter. The other difference is that the link macro is dynamically linked, it requires the files with the binary while the crate is statically linked, they're built-in to the binaries.
EDIT: At this point maybe it's just easier to rewrite wooting-rgb as a purely native rust lib instead of bindgen, rgb sdk is small enough I could do it.
I'm not sure if this is discussed already but when I'm setting up my DKS, I noticed that the end of the actuation is set to 3.6mm. Is there going to be update where the end of the actuation point can be adjustable like in the case of the start actuation point and up to 4.0mm.
I feel the "I don't know why it's broken let's just rewrite it from scratch"
yeah that's usually my goto
I probably won't, that's a lot of work and I have little free time/no motivation to do it, but it would be fairly easy to remake it in native rust without system libraries like hidapi/libusb/hidraw/libclang, actually chatgpt could probably do it lol.
Or you could write your app in C++ and not deal with the "magic" nature of Rust.
C++ is magic to me, it's a mystical monster I'm not learning
Yeah, Rust is quite a mystical monster to me too, but slowly and surely I understand.
And it seems very bad to me, coming from C++. I really don't get why people jump from C to Rust instead of C to C++. C++ solves most issues and it's backward-compatible with your old code. Like, properly backward-compatible.
I've never understood pointers which were probably the biggest hurdle to C/C++ for me, I sorta understand them conceptually now because of Rust, but at the same time why that's a commonly used part of the language astonishes me, they're dangerous foot guns
Raw pointers are not commonly used in C++ at all
Anyway, I just decompiled the thing I built on Linux. Apparently it didn't dynamically link the lib at all, it statically linked it.
That explains how the program can run, I guess.
I like not having to setup gcc/make, clang/cmake, vs/msvc, xcode, all that stuff is just handled for me, dependencies and libraries are easy to use without having to compile them as part of my own project or link to them. there's a bit of that still with rust cause of C libs
This lib version should definitely work, too.
memory is managed for me so I don't create memory leaks cause I don't know how to do that, I don't have to use a debugger for segfaults all the time, etc
Yeah, you don't leak memory because of RAII, a concept borrowed from C++.
What's RAII
Constructor acquire, destructor release
again, never touched C++, I know the newer ones are better than the more commonly used older versions and has nice features, but even trying to get a single cross platform C++ project hello world to build is a hassle for me.
#include <iostream>
int main()
{
std::cout << "Hello, world!" << std::endl;
}
clang -o hello.exe main.cpp
I think I have a C Makefile saved somwhere for gcc
SOURCES := $(wildcard *.cpp)
OBJECTS := $(patsubst %.cpp, %, $(SOURCES))
CXXFLAGS += `pkg-config --cflags fmt` -std=c++20 -O3 -pedantic -Wall -Wextra
LDLIBS += `pkg-config --libs fmt`
.PHONEY: all clean
all: clean $(OBJECTS)
clean:
$(RM) $(OBJECTS)
%: $.o
$(CC) $(LDLIBS) $< -o $@
%.o: $.cpp
$(CXX) $(CXXFLAGS) $< -o $@
I read the entire makefile docs to make that, and had a friend that knows the stuff help refine it
I admit, I don't really like Make and all these build tools. I either use Visual Studio for most of my builds on Windows, or my own build system for builds on any platform.
The tooling around C/C++ certainly isn't that great, but it's not like insane people like me haven't been there before and made decent enough tooling to use for various jobs.
Like this was in C originally, and when Tony made the Windows build stuff I was dumbfounded by how complicated it is https://github.com/ShayBox/Wooting-Profile-Switcher/tree/original
Yeah, this make stuff looks like aids
If I had added a GUI to that version it would have been Qt, but that also uses cmake and I tried setting that up, the docs are bad.
I think there's a package manager vcpkg but I never tried it
If they focused on creating a better out of the box beginner friendly user experience, one command to install everything you need: compiler, build system, package manager, formatter, linter, everything cross-platform without having to deal with 5 different systems, and pre-configured for you. I come from JS/TS/PY and most people are learning higher-level first instead of C/C++ first and taking a class on it.
Hmm, I could probably just write C++ and use rust/cargo to build C++ with bindgen/cxx or something, basically a rust wrapper around a C++ project would be the best of both worlds...
I would certainly not recommend C++ to biggers. I think it's good to start in a higher-level language, and when you understand programming well enough, and you reach the point where high-level languages are too abstract/high-level to get your work done, you can move on to C++.
I think you also need to be a bit of a perfectionist to use C++ correctly, because sometimes you can make stupid mistakes, and it is up to you to be a very harsh critic of yourself and your code.
I jumped PHP -> JS/TS -> rust lol
Being backward compatible is not the save all be all I think
also, you can use C code from rust and expose rust to C code just fine too
sure, you have to redefine the functions you use, but there are libraries that can do that for you (bindgen)
Are you sure that's all though? C does free your stack memory too, just because the CPU does it by itself. From what I understand from this chat (and very narrowly checking c++, not even using it that much), it just adds destructors to freed memory.
But what if you write it to heap? When will it release that heap memory?
Like if you want to transfer that heap memory to a library and let it manage that, it shouldn't be cleared when your function exits
but then, if it's not, how does it know when to free it? I think it does not and you have to call free
but then you always have to remember to free your memory
or use Rc
but then you can't have cyclic dependencies, which is needed for GUI and etc, which can be 'defeated' by using weak pointers
but then you forget to check that the weak pointer still exits and you get either a segfault (the good ending) or random memory garbage (the bad ending)
that's not to say it's bad, I use Rc even in rust as it's still required to allow multiple owners, but it makes my life easier (on the cost of having to bear the pain of lifetimes and borrow checker)
also rust errors (except the cargo one you got earlier, that was the most confusing rust error I've ever seen) are generally really good. It will often just straight up tell you how to fix it, especially when the language wants you to be explicit about something (or to 'fix' your habits, for example if you write fn test(): bool it will show an error about it wanting to have -> instead)
Yeah, C++ frees your heap memory, too, if you use unique_ptr, or shared_ptr (which is similar to Rust's awfully-named Rc and Arc).
I don't think they're awfully named
if they're the same, what's unique ptr about? It's not even unique
uniquely bound to single thread? maybe singlethreaded_ptr ???
Rc - Reference counted, describes what it does quite well I think
You can find some bad namings or non-obvious names, I don't think rc is one of them
btw I'm not advocating rust is perfect, just that it might be a better choice for someone
also I'm learning some things about cpp from this chat as well, so thanks for that
unique_ptr means only a single owner basically
so it's not Rc
wait single owner at all times?
that sounds like a borrow checker
except, weird
ohhh
smart pointers
that really does sound like a borrow checker within cpp
hm
I misunderstood your message before, now I think I understand it
unique_ptr is the same as owned object in rust
shared_ptr is a reference counted object
except it doesn't require mutex for shared access
After learning everything there is to know about Rust (I still haven't) I could see learning C++ being much easier. I wouldn't use it for a new project, but I could see being able to edit an existing project would be a nice ability.
I wonder what do you think you missed about rust, at least core rust itself
especially since you already used bindgens and externs.
macros maybe?
I don't get how this can ever be an issue if you have a clear idea of how your structures are supposed to work. For example, if you have a tree structure and you need a parent-pointer, it's alright to use a raw pointer, because you know a parent owns its children (e.g. in a vector of unique_ptr), so the lifetime semantics are very clear — the parent will always outlive the child, even if only by a few ns.
yeah and then you move the child to a different parent
it's more like rust forces you to check everything while cpp let's you have your own fun
Then you update the parent-pointer?
Somehow I just imagined moving a button from one window to another
What lol
I understand macros but not much practice/experience, I still haven't played with Bevy which teaches you a lot of Rust ergonomics with state, base crates like syn/nom.
I should have used syn lol
I was like naah I'll use std rust that will be fine
1000 lines later it was not fine
What were you trying to do?
svelte is a great thing, but there's not really a good ui lib in rust
so uhh
I'm trying a bit
Ah, web dev and Rust, just the things I am absolutely clueless about
Well, okay, I know you can deploy HTML, CSS, and JS on a web server and/or CDN
but that's not cool
We need more abstraction, more boilerplate, and more overhead
the idea to use a higher level lang to generate HTML and poop out all the stuff is to write less code and not have rigid HTML files you need to hand write and maintain
Wait, seriously, people think HTML is the problem in web dev?
Like, HTML is the chill part. CSS and JS is where the pain starts.
well people started using js to make html more dynamic
We had a tool for that, it was called PHP
which
is the exact same as using node or rust or c#
you have a higher level lang (in this case interpreted) generating html with its js and css
Oh, so it's like a CMS or templating engine?
well no a cms would be sort of a meta construct build ontop of PHP, node or whatever lang you use to more dynamically crank out html while maintaining some form of database which can be used by the same underlying language to serve html
a templating engine is just used by said same programming languages to well template html for easier reusing of parts
the problem we tried to solve was how rigid html itself is
and we cant solve everything with clientside js
everything you currently use on the web is (most likely) completely impossible with just html and css
despite those 2 technically being turing complete
I mean, I think PHP can replicate everything JS can do, just with more latency and wasted server resources...
well no it can do more
DOM-wise, anyway
even DOM wise as you technically can spit out no script tags at all
the advantage is just a clear split between server side and client side data
I really feel like web dev is going in circles
well that depends on who you ask and what level of webdev they do
I'm sticking to uploading HTML, CSS, and JS to my Linux VPS thank you very much
that can only do so much though
It can do literally everything
and its sort of like saying well i can type my word documents on dos 3.1 thank you very much
no
What can it not do?
Yeah, it worked, and it had much lower hardware requirements?
i mean how about you try building a cms with just those 3 and keep in mind you can only use html, css and js files no rest servers or such
or better yet rebuild uwuting.com with just those 3 things
Well, technically could do it with NodeJS
thats not webjs
but I would typically use PHP for the API routes
so you waste the same resources you didnt like being wasted for spitting out html
so?
Interesting website tho
Is it meant to look like this?
No it does know emojis, just not this one apparently
I am on Chrome 118 on Windows 10
That looks fine, but also Discord uses (their own fork of) Twimoji to display them client-side
because they're not (that) stupid, they know emojis aren't universal
Is interesting, it literally doesn't show up
anyway html, css and js cant solve everything on their own and as soon as you have to involve an API you may as well use PHP, nodejs or whatever
Well, yeah, but the frontend can easily be done in HTML, I don't see the issue with that
the issue is i dont want a slow af mobile device to chug js
my server has 0 issues running a loop and concating some strings and spitting out html
in less than a few ms
My server has no issue running Apache2, serving static HTML files in less than a few ms
ok so what if the client now takes a second or 2 running whatever js bloat file you send over with hundreds of kb
thats whats killing the web
everyone stuffing their mom and grandma into js
There is no JS bloat on my websites
and massive css sheets
jQuery at worst
jQuery makes JS so much better to use tho so its worth it
Also far from a bloaty framework
welp i dont need it at all
Yes of course
ok how much more does that website do than your js
not to mention i try reducing clientside js as much as possible moving to server side rendered as much as possible
Well, let's see, I have 0 JS files loaded on my websites
(I use inline <script> tags)
which doesnt make it better
wheres this website
Not relevant to the discussion
i mean you seem to have high claims that your website can compare to youtube and twitch and co without using server side rendering
I'm not saying it is functionally identical to either of these sites
I think I could make services functionally identical to Youtube or Twitch using my principles
the limitation is that html5 and css can do a lot but not everything
but one of my principles is "don't burn money", sooo 😄
a poc doesnt require burning money
Well, for a proof-of-concept, I could cheat a bunch
but actually making a streaming service, or hosting tonnes of videos with acceptable streaming speeds
hayyeelll noooo
dont need to host a bunch
3 or 4 videos on disk, a few million randomly generated entries all linking to one of those at random
and then limit people to upload 10mb or so at best
then you can have a solid poc that demonstrates you can replicate this
If I'm not gonna give it my best, why bother at all
not to mention google would prob pay well if they can reduce all the processing they do to spit out html
I think they know they can, they just rather hire incompetent people with their fancy JS frameworks because they're more plentiful
so
I mean why do you think people hire Rust devs? It's not that C++ is worse, it's that it's harder to find good C++ devs.
they spend more money
to save less
despite the option to spend more and save more existing
Rust may add bloat, but it removes human error, making it a better choice for a company
i still dont know how they add bloat
But I think the Youtube homepage is pretty optimised anyway
I mean, I don't know the specifics of their tech stack, but I highly doubt it's a lot of effort for them to serve it
They probably squeezed every metric as far as they could without compromising important values
its not a lot of effort for anyone to serve dynamic html out of a webserver
you just throw out slow stuff like apache2
and then youre already good
Apache2 is fine for a hybrid web server
NGINX is good for static content, poo for dynamic tho
just use caddy and be done with either
Isn't that just an NGINX fork?
dont even think about lighttpd
if nginx fork means completely written in go from the ground up
and not forked from nginx
then yes
Love the sarcasm
idk if anyone wants to fork nginx
Might have to try caddy some day
Cloudflare be like
tbh, I'm on such a wheel-reinventing spree, I might actually make a better web server (for my own needs) than caddy before I try it
if i ever get around to it ill flip my private root to use caddy just cause its so much nicer
including the fact it talks REST for reconfiguring it
Hmm, interesting
I'm still stuck on developing my own DNS server, so getting to HTTP might take a hot minute
At least my DNS server can issue TLS certs, that gotta count for something, right 
i assume all using your own self developed programming language
No, using C++
well now im disappointed
I gotta get shit done lol
obligatory did you know that native js now has most things that jquery has
if you have lots of them it's better to have them as separate files for caching
oh yes lodash everywhere my beloved
i think lodash has like 1 or 2 functions i find useful but its nicer to write them myself lol
it's funny that devtools have $ as an alias but js itself does not
copilot can write most lodash stuff anyway
anyone with some knowledge of js can
yeah
same for making a custom $ var to replace jquery
well, tbf that $ is overloaded, which I don't think is great but may be useful for someone I guess
like you can select elements or create them
yeah but who uses all of that
yeah
i think most people use the select itself
I dunno I didn't use jquery that much, just when starting with JS (after learning PHP), then migrated to using svelte
but yeah
wasn't it the other way around? Replacing nginx with custom modules with their own custom web server?
Really depends. For my use cases, it is negligible amounts of JS just to make a particular page work, with another small JS file containing commons, included only in pages that need those commons, hence why I can get away with saying "0 JS files"
fair
I'm kind of on the other side of the spectrum, using a full framework with lots of JS everywhere
im still trying to fiddle out moving as much as possible server side
but I think if you spend a bit on optimizing stuff you can still get away with it
but my bane rn is form validation
Yeah, that seems to be the mainstream approach. I can't blame you. It's probably easier to go with the flock, use their tooling, and just get shit done.
yeah, especially when the tooling is great
you can also just build a static site without js with the same tooling
then it just helps with organizing files
I just have a really hard time accepting abstractions that are not solving any of my problems and just seem to add more complications, bloat, and boilerplate
I just like websites that are fast, and JS does help with that
I dislike react too
but I think if the boilerplate is hidden, or is generated automatically then it's fine
Then the boilerplate is called bloat 😛
hm
what OS are you running again? :P
especially since all modern computing is abastraction over abstraction all the way down
prob non gentoo
I mean even x86_64 instructions is only an abstraction, as the cpu has microcode that translates the instructions to 'real' instructions
but i do prefer macos for anything else really
so you have bloat at the cpu level
lighthouse
yeah page insight uses the same except it runs on google servers, lighthouse runs on your machine
it's built into chrome devtools, and available as a command (though I never used the command)
the only thing i dont like about pageinsight is that it always without fail recommends using next gen image formats
even if they just save 1 or 2kb
its like why flag something for that
also cpu is just an abstraction over gates
you should just use FPGAs for everything
yeah
they like to push webp
(after dropping support for jpegxl)
Damn, my website does not seem very accessible
nice perf
idk what these seconds are
I didn't compress small images enough (I think it's like 300kb)
the CDN delivers the content in like 60 ms, it can draw basically instantly
expand view shows more details
TLDR
FCP -> first draw on website that has real content
LCP -> largest drawn object
blocking time -> main js
layout shift -> how much the site moves during load
speed index -> I think that's until the page loads almost fully, but I'm not sure
I mean, my website loads in like 300 ms tops
kinda weird that you say the cdn delivers content in 60ms and then it takes 2 seconds to render with 0 blocking time
did you not compress your images?
ooh wait
in the main page switch to desktop
you may be measuring mobile which is rate limited to 3g speeds
so that shows it would load in 2s under 3g
yeah that seems more like it :D
Still a bit odd
see and here I have almost the same timings except LCP, which is because the main image takes half the screen and half the bandwidth for that
but, well, this is basically as close to bare HTML and CSS as it gets, the only JS on this page is a small <script> tag, lol
and it's basically as far from bare HTML and CSS as it gets
a SPA with transitions between pages, animations, etc
yeah
SPA is nice, but also adds overhead when loading, right?
my FCP seems to be lower, although that might be difference between our internet etc
also, there's hydratation - the website is fully rendered as html and css which the browser can show, and then once that is shown the JS is loaded in the background to make it react to user events
my website should work almost as is without js, just without animations
basically it's what you're doing
you ship HTML and CSS to the client as you normally would
but then JS is loaded in the background and takes over the website once loaded, acting as SPA from this point on
so you have the load speed of SSR with interactivity of SPA
here it means that my website is fully static (it's built once into HTML+CSS+JS) and works without JS, but if you have it enabled you'll see animations, faster loading (as it loads only content that it doesn't already have instead of the whole DOM) and more interactivity
So, hydration is the process of loading a (hopefully) small script that handles SPA logic?
i mean you can hydrate 10mb of js if you want
I really don't want to
but usually you hydrate bits and pieces as needed
well, normal SPA loads only that javascript with no content to be shown if you don't have js
I don't even wanna think about 10 mb of JS in general
That is too much code in a bad language
Write it in C++, compile it to WASM, jfc
think of
<head><title>something</title></head><body><script src="./spa.js" /></body>
why? there's nothing to be shown anyway
hydratation is a mix of both
basically something framework people invented to make it behave more like le olde php sites with javascript
I don't really like making SPAs since I find the overhead of loading a new page is minimal anyway
but once initially loaded, clicking on links doesn't reset browser state like it would normally, but JS takes over and only replaces stuff that changed
but I can appreciate it I suppose
yeah but you can still see your navbar without it moving around etc
and you can have cross-page transitions
also wasm has way bigger overhead, it's both slower (as it needs JS to access DOM anyway) and bigger in file size
Well, they are adding CSS attributes for that, no?
yeah
but it's not portable yet
not sure if it's even available to normal clients, it was under a feature flag until very recently
i really dont know if the trend of have css fix a lot of "issues" is good
I think the behaviour of having the new page load and then replacing the view works fine
e.g., navbar stays put
I think css is a great programming language
all my homies code in css

other thing is that you can have different behaviour
for example twitter(x) uses this, so that if you click on an image it will change URL but the background of the page stays the same. If you refresh, the background is gone and the image is the only thing on the page. Sort of like android activity if you know what I mean
(All this page does is load WASM code that generates a QR code then renders it)
so no real workload in the sense of having performance improvements or impact
I think wasm is nice and has a good future, but currently it seems it's more supported outside the browser than in it, thanks to cloudnative folks
Yeah, that stuff is nice
Huh? It's supported in all relevant browsers
it is supported, but you can't change DOM from inside it, memory management is iffy, and communicating with JS is not that good either
Plus, code reuse is always good
yeah, that's why I use sveltekit for both FE and BE :)
The same code I use to generate QR codes on my Windows app can also generate QR codes on my web apps. 10/10.
you could also save time by using existing libraries

here we go again
We building software CAPITAL, not a software CITY.
(Bad pun)
(idk if you guys are familiar with the concept of software capital, it might be a niche idea)
(it's basically the opposite of tech debt)
I only ever heard of tech debt
because all code is bad and there should be the least possible code in the project
i mean thats how AAA games work in 2023 right
More code is generally better, it means more features, more functionality, better software, more desirable software
Thing is, people tend to be bad at writing software, they do it too fast, they don't have a clear vision, and they write buggy, unmaintainable messes
like, writing a website made out of many microservices, a message queue, document database, etc
only for it to be used by about one school
it's awful to debug and has a lot of boilerplate for every new feature
I'm proud of the work I do in C++ tho, all of it. And really, my only regret with it is: not writing more code.
It should have more features
It should be better
Same, I try to make simple programs
My UwU has arrived 
The default key mapping is "zxc"?!
I'm guessing that's a Osu thing I don't understand. Otherwise, missed opportunity to make it "uwu"
it is the lower left corner of alpha num which osu players use
or well most osu players
Device up to date 
well its not as you can see it says update available
cause its disconnected
we dont check fw of disconnected devices as the cached version is not necessarily whats on the kbd
might be good to hide it though
will post it internally
Alright
I ended up reporting this btw: https://github.com/WootingKb/wootility-issues/issues/251
Probably not of any use tho
for simon to decide
Simon my beloved 
It is interesting tho because in theory, input reports sent while the event listener is not registered should be discarded
And it seems like the event listener is only registered when the Wootility expects a response
inb4 Chrome bug lol
I just realised, both the Wootility and uwuting.com use Chakra UI. I see you, Tony. 
makes sense wootility expects rgb responses cause it sends rgb stuff
thats how the realtime preview works
urg, it seems that while a DKS key is pressed, it eats up any non-DKS key being pressed
Can't have my UwU type ">.<" when I smash my hand on it
It just types "><"
Well the issue of interleaving comes from not using input reports. I must be carful to not accidently start Wootility while my tool is running. Otherwise Wootility nukes my keyboard config

Well or instead of using HID input reports, it would already be sufficient to just have all metadata of the message
As far as I remember I have a somewhat wonky detection for unexpected reports
Like I expect a certain byte to be zero/non-zero
Actually, it's even weirder, because WootDevRawReport has no response
Yet sending this alone makes it error out
Ah wait, no, I do also deinit
Right, okay, so I send it WootDevResetAll (D0 DA 20), it responds with D0 DA 20 88. So the Wootility could check byte at index 2 to see if it matches what it expected.
But I'm happy this works: HidD_GetSerialNumberString
There are certain vendors which just supply an empty string
It might not be a vendor issue, I think it's a Windows issue, at least in some regards.
How?
Any HID connected via BT or BTLE will not have a serial# reported
Hmm, idk what's up with that
Maybe they don't think it's important to make it work via HID
My Razer mouse also isn't reporting a serial
Well a mandatory field just added with an empty string... I'm not sure if that was the intention of having it mandatory
It's not even reporting the vendor + product string on all interfaces 💀
1 c twice?
Yeah, happens, they have some duplicates
On the keyboards it's even worse
There are different interfaces with different reports but all the same usage and shit
Wooting is spoiling us
Hmm, the Wooting UwU makes for an excellent Morse Key. Wonder if there's a more efficient encoding than Morse code that can make use of the 3 keys.
Well, 3 keys does allow us to press the keys down in 7 distinct ways. If we use pairs of 2, we could have 49 different inputs. Enough for alphanum and some punctuation.
Although I kinda like the tree-like nature of Morse code, would be cool if every input was like taking a path down a tree. >.<
Did you ever try C++ modules?
Well, yes, but not really. I tried using them as a means of compiling .hpp files which was kinda cursed, but somehow did work.
The key mapping went a bit insane towards the end there, but the most common keys can be typed in only 2 "hand smashes"
If anyone is interested: https://github.com/Sainan/uwu-code
Ah shit I just realised there's no backspace, that'd be a useful key to have xD
I managed to mostly memorise the UwU code, got 9.37 wpm with 98% accuracy, although I feel like I'm developing carpal tunnel lol
A few of things:
- Could you make a git repo that just has all of the shared object files so it's easy to use with git submodules? (I.E.
git submodule add <repo>and friends) - What are the terms for shipping the shared object files?
- Can I just have the shared object files in my public repos?
we have the binaries checked into git for Artemis and Aurora
There also really should be a way to redirect the stderr output because I have my own logger in this program. .-.
Are you refering to the Analog SDK?
You can use the RUST_LOG environment variable to put a leash on that, e.g. use "off" to disable it.
I must admit, tho, the logging is really silly for a shared library.
I shouldn't have to do such a silly thing for that.
I think I'll open an issue about it....
Yeah but I'd have to go in and use more natives for that and it's just a big pain.
Well, if you wanna be fancy, you can look for a HID device with the Wooting VID, look for usage page 0xFF54, and read the analogue reports yourself 😉
but then you're missing out on the vast ecosystem of Wooting Analog SDK Plugins
(I at least made one that makes it support the Razer Huntsman V2 Analog keyboards as well)
Oh it's open source but as pointed out it is Rust.
Which makes it very hard to submit a PR for. .-.
But Rust is the best!!! How dare you criticise our beloved crab language!!!
It really isn't "best".
Don't let them hear that 😉
C♯? I prefer D♭.
Speaking of music... Where does F5 and onward go? There's not enough keys on a keyboard to make for a proper piano 
It's only 88 keys.
At least it's enough to play Auld Lang Syne 
I was trying to install the Wooting Analog SDK ( https://github.com/WootingKb/wooting-analog-sdk ), and when I tried to launch wooting-analog-virtual-control, I got the following error: Error : Cannot find unique os path since link_file does not exist
Does anyone know how to fix this?
I am trying to manually install the SDK on Arch Linux (There is currently no AUR package)
Nevermind, I just read this
Is there any example programs that use the SDK and show the current key press status of the keyboard
like just how far pressed each key is
I guess I could probably make something like that myself, I just wanted to see if I had installled the SDK correctly with something like that
This would probably fit the bill: https://github.com/WootingKb/wooting-analog-midi
List of awesomeness around Wooting keyboards. Contribute to WootingKb/awesome-wooting development by creating an account on GitHub.
I'm currently trying to port https://github.com/DjCrqss/Woot-verlay to Linux, and C# is very confusing. All of the documentation I can find expects you to use Visual Studio and let it handle all sorts of things, rather than using the command line and a normal text editor to do stuff.
you can do everything with a text editor and the dotnet command line utility. from a rough look at that c#, most should be portable to Linux. I'm not sure what the NeatInput.Windows is for though.
if you're on arch you can get everything from the aur
you'd also need to switch to a different UI framework which might be a little too much work :p
porting to something else might be faster
Yeah I was trying to use this: https://platform.uno/ , but I have no clue how the .csproj is suposed to look for this, because all of the documentation just says to setup a project with Visual Studio
I can't comment on that, I've only used Avalonia for UI on Linux and it's pretty good
but i don;t think c# is the right tool for the job
I would prefer to keep in C# because that’s what the original author wrote the project in, and by keeping it in C# they will likely continue to maintain it
Although if I were writing it, I would not use C#
I have never touched C# before today because it is steeped in Proprietary Microsoft stuff
So, I gave up, and I am messing around with the Wooting SDK in rust now
I currrently have this code:
use core::time;
use std::thread::sleep;
fn main() {
use wooting_sdk::{
analog::read_analog_key,
rgb::RgbKeyboard,
Key
};
let min = u8::min_value();
let max = u8::max_value();
// Check how far down W has been pressed..
match read_analog_key(Key::W) {
Ok(press_amount) => {
match press_amount {
min => { println!("When the key is not pressed :skull:"); /* ..not pressed. */ },
max => { /* ..completely pressed. */ },
_ => { /* ..partially pressed. */ }
}
},
Err(error) => { println!("{}", error.to_string()); }
}
let mut keyboard = RgbKeyboard::default();
// Modify the keyboard array so QWERTY will be set to white..
keyboard.array_set_full(&[
(Key::Q, (255, 255, 255)),
(Key::W, (255, 255, 255)),
(Key::E, (255, 255, 255)),
(Key::R, (255, 255, 255)),
(Key::T, (255, 255, 255)),
(Key::Y, (255, 255, 255)),
]);
// ..and apply the change.
keyboard.array_update();
sleep(time::Duration::from_secs(5));
println!("Hello, world!");
}
Which is basically taken from here: https://docs.rs/wooting-sdk/latest/wooting_sdk/
API documentation for the Rust wooting_sdk crate.
However, when I run this, I get the error Wooting keyboard is not connected
I have a wooting two he connnected , and wootility recognizes it
Dang there's a new model of those things?
You're on Linux, right?
You need to do the permission dance if you want to use the HID analogue interfaces as non-root: https://help.wooting.io/en/article/wootility-configuring-device-access-for-wootility-under-linux-udev-rules-r6lb2o/
I already did that, and that’s why Wootility is able to detect it
Unless the SDK needs different udev rules than Wootility
Hmm, no, that should be fine
Oh, wooting_sdk... this is not the official one. This is abandonware.
Yes, it should be called "wooting-analog-sdk" or "wooting-analog-wrapper"
Ok, thank you
Actually, it seems they're not on crates.io
Maybe you're just supposed to clone the repo: https://github.com/WootingKb/wooting-analog-sdk
So, yeah, that works. Just add this to your Cargo.toml:
[dependencies]
wooting-analog-wrapper = { path = "../Repos/wooting-analog-sdk/wooting-analog-wrapper" }
(Be sure to use a path that matches your setup.)
And then you can use it as follows:
fn main()
{
wooting_analog_wrapper::initialise().as_ref().expect("failed to init sdk");
loop
{
println!("{}", wooting_analog_wrapper::read_analog(0x04).as_ref().unwrap());
};
}
(Silly example. In the real world, you'd probably read the full buffer and not just the 'A' key.)
This should probably be added to the crates.io repository, tho. Not sure why it's not there.
I just realised you can just do this:
[dependencies]
wooting-analog-wrapper = { git = "https://github.com/WootingKb/wooting-analog-sdk" }
hey, that reminds me of something ;)
rust rgb sdk seems to be broken, but you can just use the C lib directly just fine using extern.
the analog sdk, I think, is in rust directly so that should work fine
for example, install wooting-rgb-sdk as a system library (it's in the AUR)
#[link(name = "wooting-rgb-sdk")]
extern {
fn wooting_usb_find_keyboard() -> bool;
fn wooting_rgb_array_set_full(colors_buffer: *const u8) -> bool;
fn wooting_rgb_reset() -> bool;
fn wooting_rgb_array_update_keyboard() -> bool;
}
for basic RGB functionality. I made a simple app to show images on the keyboard: https://github.com/danbulant/wooting-fun/blob/master/src/main.rs
The RGB SDK is a bit of a mess, were you trying to use the existing rust wrapper for the RGB SDK? I'm not sure if that's being actively maintained
@quick bough I did a bit of a follow-up to your changes to the C Plugin interface as I noticed it caused tests to fail (as the test_c_plugin hadn't been updated). I ended up doing an overall cleanup pass on it, you wanna have a look over it and try it out to see if it works well with your plugin set-up? https://github.com/WootingKb/wooting-analog-plugin-examples
Contribute to WootingKb/wooting-analog-plugin-examples development by creating an account on GitHub.
It is maintained by one of the people in here. It's the same guy that maintains the sdk in aur, and he updated both few weeks ago when I asked about my project here.
It does work on windows but not on Linux and we couldn't find out why, as it's just a wrapper around the C lib and the c lib works, and I just literally copied parts of the wrapper I used and it worked too
What error do you get on Linux?
@floral crane
Nothing, it just doesn't find the keyboard, ie the function to find keyboard returns false
And all other calls are essentially ignored
Well, removing the _ is a breaking ABI change, init?
Oh, I see now, the way C plugins were supposed to construct a device info was by calling new_device_info. I'm not sure how they were supposed to link against this, tho.
So, I guess this is all a breaking ABI change, but I suppose it's for the better.
Ah, this also fixes the fact that the test_c_plugin is such a PITA to build btw
lol
Yeah, works fine with the new ABI
Made some more changes that probably won't hurt: https://github.com/WootingKb/wooting-analog-sdk/pull/67
Funny because even the "wooting-analog-plugin-examples" repo didn't do this
The C rgb sdk works, but my updated fork of the old rgb wrapper/bindgen doesn't detect keyboards on linux. I tried hidapi/libusb/hidraw/udev but no difference.
Tried with udev rules, sudo/root permission, I don't know why it doesn't work. https://github.com/ShayBox/Wooting-RGB
lol. Ye, overall this feels a lot clear, is a breaking change, but AFAIK, you're the only one that's used the c plugin abi lol. I've merged your changes now, is a nice extra bit, ty
huh, that's quite strange
My PRs always making the CI fail 
Yeah, am not sure why it's not triggering the CI in the PR itself, I guess there's something I need to tweak to get it there? Anyway, I think it's erroring now because the generated headers are still referenceing the new_device_info func that you removed, so the generation just needs run again
You would have to change this to on: [push, pull_request] I think
Also my copy of cargo doesn't seem to recognise this command
cargo install cargo-make
cargo install cargo-binstall
?
binary install
I don't think I need that?
no, but you don't have to compile everything
Meh, might as well make my CPU work for it
Anyway, does seem that test-flow also fails on my machine
binstall is good for workflows to reduce build time (compile time) of dependencies
I don't get this error: "Bindings changed"
I mean, it seems like something needs to be updated for the new bindings... whatever bindings means
Yay, a green checkmark: https://github.com/WootingKb/wooting-analog-sdk/pull/68
NeatInput was a simple keyboard hook library I found to listen to the kb events so that the program knows if a key is active or not (as the analog api only shows pressure values) - I have opened an issue on the project of potential Linux replacements but haven't gotten around to trying them sadly
To temporarily run on Linux u should be able to remove the NeatInput library and replace the 'active' values to 0 or replace the library and then remove the Tray application that gets created and it can run in the console
Ah you want to know if it's actuated as well, that makes sense
Yeah I'm not sure if there are easy ways to grab input on Linux, for Artemis I'm parsing dev input directly.
Doesn't that require root?
yeah, i usually tell users to add themselves to the input group. If you have less stupid suggestions i'm all ears. i realise this is not great permissions-wise lol
Nah, I have no better ideas myself. I think the only way you can get input on Linux is to have a window with keyboard focus and retrieve the events.
Which is why I don't bother porting most of my stuff to Linux 😄
i mainly didnt want to add x11 and wayland separately... the /dev/input was more of a test and it seems to work great
having the default user access that file is not great for security though, unsure how to handle that
I just use X11. I'm assuming that would work with all distros. If not, L to those distros I guess.
yeah lol, i'm still stuck in how to listen to output devices (for audio effects). I sort of have it working with pulse but it's very non-standard and requires the user to configure it correctly with monitor sinks etc
fedora comes with wayland by default nowadays, unsure about other distros
Hmm, I was just trying to do audio on Linux recently. Had a funny bug where "default" as non-root user would pick a different device that didn't support async
but "sysdefault" doesn't seem to have that issue
I am also not sure how to reasonably iterate output devices on Linux since ALSA doesn't seem to have the kind of enumerators that Windows has
and the "devices" don't have proper names
I find Wine to be most impressive. They had to deal with all of the garbage Linux had to offer with audio, input, peripherals, etc. and they had to make it work with apps written against sane APIs.
And it's also a great excuse for me to not port my apps to Linux. 😄
Although it seems even Wine doesn't have a good alternative for DirectInput
It can only say which keys are pressed when a window owned by the app has focus
That is so cringe
You shouldn't use ALSA directly unless you have a very good reason. Instead target PulseAudio or PipeWire
Isn't ALSA just a common interface for PulseAudio, PipeWire, etc?
X11 allows any client to listen to all input and swallow it. Wayland compositors don't allow this (yet! Hopefully soon the global shortcut portal starts being implemented..)
I don't think it does, since it only provides input to the window with keyboard focus
ALSA is the kernel level interface. If you want to write drivers for your fancy audio device or want the lowest possible latency you want to target it
Well, ALSA seemed like the easiest way to port my Windows audio stuff to Linux
So, that's my reason for using it
Wine I don't know what it does exactly, but I know for sure X11 allows global input grabbing
For better or worse..
Do enlighten me as to how one would grab input globally with X11
I'd still need to create a window for that to work, tho, right?
I don't do X11 stuff so don't ask me
Alright
But probably something with XGrabKey and friends
And maybe XSelectInput
And PipeWire is simple enough in my experience to get noise out of the default output https://docs.pipewire.org/page_tutorial4.html
XGrabKeyboard seems interesting, but I think that would yank the keyboard away from other apps
yeah but targeting pipewire only is not a great idea (yet?)
Yeah right now Pulse is better for wide compatibility
Because almost all distros right now use either Pulse or Pipe, so it's better to target those for better functionality
All the functionality I need is pushing PCM samples, that works fine
And if you start using ALSA you either steal a device all for yourself, silencing all other audio, or it roundtrips through the PW/PA ALSA wrapper which... works, ok...ish..

Hmm, yeah, it does seem like I'm not able to play sound while Chrome is playing sound
So, the alternative is to use PipeWire or PulseAudio, but that depends on whatever is installed on the distro?
Yeah, target Pulse for wide compatibility, target Pipe if you want to be fancy pants modern
Better yet target both
What a waste of time
Literally bothered with ALSA for something that doesn't even work like half the time
This is what happens when you don't pay 200 euros for your Windows 10 Pro license. You pay in days wasted.
Yeah although to be honest I really like PipeWire, being able to freely plug audio from any app into any app taking audio is nice, not having to worry about any virtual audio cable nonsense
Is it still crap today?
I remember trying... I guess it was Ubuntu a while ago. Per default it came with a non-functional audio mixer.
PipeWire replicates PulseAudio to the point that Pulse Effects and pavucontrol worked flawlessly on it, so unless you have issues with older hardware and need PulseAudio, I recommend PipeWire.
I would suggest Pulse Effects/PipeWire Effects but since they switched to GTK4 and native PipeWire it's been kinda shit, especially if you use OBS, it's completely broken with OBS, but you can use the old unmaintained PulseAudio version with PipeWire still.
What's Up My Wootiggas!


Idk why but this damn SDK is super unstable with init & deinit, but only with wooting-analog-plugin
Well, yay for PDBs:
[12/11/2023 02:13:04] ---- ERROR INFORMATION BEGINS ----
Type: Caught ACCESS_VIOLATION while reading from FFFFFFFFFFFFFFFF
Message: Caught an exception.
Stack Trace:
00007FFBF247AB38 (wooting_analog_sdk.DLL+000000000002AB38): core::core_arch::x86::sse2::_mm_load_si128 in /rustc/db7ff98a72f3e742b641f9cb16d0e8c285e87e9b\library\core\src\..\..\stdarch\crates\core_arch\src\x86\sse2.rs on line 1188
00007FFBF2470747 (wooting_analog_sdk.DLL+0000000000020747): hashbrown::raw::RawIterRange<tuple$<u16,f32> >::new<tuple$<u16,f32> > in C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.0\src\raw\mod.rs on line 2760
00007FFBF24755EC (wooting_analog_sdk.DLL+00000000000255EC): hashbrown::raw::RawTable<tuple$<u16,f32>,alloc::alloc::Global>::iter<tuple$<u16,f32>,alloc::alloc::Global> in C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.0\src\raw\mod.rs on line 1428
00007FFBF2475928 (wooting_analog_sdk.DLL+0000000000025928): hashbrown::raw::RawTable<tuple$<u16,f32>,alloc::alloc::Global>::drain<tuple$<u16,f32>,alloc::alloc::Global> in C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hashbrown-0.14.0\src\raw\mod.rs on line 1454
00007FFBF246C766 (wooting_analog_sdk.DLL+000000000001C766): std::collections::hash::map::HashMap<u16,f32,std::collections::hash::map::RandomState>::drain<u16,f32,std::collections::hash::map::RandomState> in /rustc/db7ff98a72f3e742b641f9cb16d0e8c285e87e9b\library\std\src\collections\hash\map.rs on line 617
00007FFBF2454BCA (wooting_analog_sdk.DLL+0000000000004BCA): wooting_analog_sdk::sdk::AnalogSDK::read_full_buffer in C:\Users\Sainan\Desktop\Repos\wooting-analog-sdk\wooting-analog-sdk\src\sdk.rs on line 417
00007FFBF245AA5A (wooting_analog_sdk.DLL+000000000000AA5A): wooting_analog_sdk::ffi::wooting_analog_read_full_buffer_device in C:\Users\Sainan\Desktop\Repos\wooting-analog-sdk\wooting-analog-sdk\src\ffi.rs on line 326
00007FFBF245A8FD (wooting_analog_sdk.DLL+000000000000A8FD): wooting_analog_sdk::ffi::wooting_analog_read_full_buffer in C:\Users\Sainan\Desktop\Repos\wooting-analog-sdk\wooting-analog-sdk\src\ffi.rs on line 289
If I had to guess, it's a concurrent access into the same map without a mutex?
I have no idea, but I love how none of the offending code seems to be in an unsafe block 😄
This may have been an ABI incompatibility issue (Just Rust things ❤️) because I used the latest wooting-analog-sdk with an older wooting-analog-plugin
The fact that this can even be an issue makes me think that allowing plugins with the Rust ABI at all is not such a good idea. It would probably be best to use the C ABI for all plugins. Would also streamline the plugin stuff a lot, I reckon.
There is still an issue with the wooting-analog-plugin randomly crashing when using init & deinit a lot, and I don't mean this: https://github.com/WootingKb/wooting-analog-sdk/issues/18
Because I am fully unloading the wooting-analog-sdk DLL after deinit, so it's a clean slate. It just seems to be a random thing where the wooting-analog-plugin just crashes on deinit.
It's WootingPlugin::timer. The mere existence of this introduces like 200 KB of extra code bloat and instability when the plugin is dropped/unloaded.
A Rust-enjoying acquaintance of mine suggested https://github.com/ZettaScaleLabs/stabby, might be worth a look if we want this impl Plugin for ... pattern to exist for more than just the bundled WootingPlugin. 🙂
Technically, same issue for C++
Not really. Standard library maintainers either ensure types remain stable, or they make an ABI break so the dynamic linker knows something is wrong.
In this case, Rust the standard library seems to have been modified in a breaking way, yet the dynamic linker did not know anything was wrong so still loaded this faulty code, for it to crash at runtime.
Well... it's not so easy
Of course, ideally you would use C ABI for the most compatibility anyway.
First you must link to the same standard library
I mean, all I can say is that I never had this issue in C++. Maybe part of it is because C++ devs don't try to rely on an unreliable ABI, instead using C ABI for compat.
Also... which linker?
The dynamic linker is a part of the OS
I thought it was about plugins
It is what makes DLLs/shared objects work
Can you load plugins using the OS linker?
The OS' dynamic linker is what load plugins
Link?
Yes, it loads the DLL, maps it into memory, and links it.
I mean URL to the documentation
As well as some other stuff, dynamic initialisation, exception tables, whatnot
Uhh, I don't have a documentation for this
Just trust me, this is what happens when you call LoadLibrary 
Via GetProcAddress?
Yeah
Then you're the dynamic linker
Very funny
I mean the "import" tables are what get resolved by the OS
Via the "export" table from the DLL
Which is also what GetProcAddress uses to fetch your symbols
Okay, but that's also not an issue for Rust, is it?
The issue comes when all the dynamic linking succeeds, so your library has successfully loaded, and then it crashes at runtime because of incompatible data
Now, in regards to C++. On Windows, this would never be an issue because Microsoft is so anal about compat. On Linux, the dynamic linker will cry because standard library version mismatch and it fails to start/load.
"We've changed this behavior in Visual Studio 2015 and later versions. The runtime libraries and apps compiled by any of these versions of the compiler are binary-compatible."
Yeah, they do make major version bumps when it breaks
But there are exceptions
but they haven't made a major version bump since 2015 iirc
So I consider it basically a non-issue on Windows nowadays
But it could happen
It could, but then you would be acutely aware of it
It's probably only stable, because that language is 40 years old
That's a lot of time to get is finally stable
But again, in my C++ code, I have only ever used the C ABI for talking even to other C++ code, simply because it is the most universal, most compatible, and doesn't introduce redundancies by having multiple ABIs.
For Rust it's probably just a matter of time until the ABI becomes stable
Sure, I don't blame Rust for not having a stable ABI per-se, it's not like they keep it a secret
It's just silly that Wooting's plugin system is relying on something so fragile
However I'm irritated, that didn't sort out ABI compatibility. I thought Rust was designed to get away from C++ flaws ^^
LOL
Rust is designed to get away from C's flaws, except C++ already solved all of C's flaws ages ago
extern "C" 
No, not this
There are some stupid rules in C++ inherited from C and they can't be changed because of backwards compatibility with old code
Ah, yeah
I mean it's whatever, I don't think it's that hard to write proper C++ if you just familiarise yourself with "What's a footgun and what's not"
I would prefer C++ without the footguns ^^
I admit, it's funny to say that, but it's pretty easy to tell you're messing up when you're using raw pointers, which is really the only pitfall inherited from C
Raw pointers are okay
And it's still good that I have access to raw pointers, because sometimes that's exactly what you need, but it's way too easy to misuse them
And subsequently leak memory
Some of the implicit conversions are just stupid
Well, you can have it the other way around, where you only have explicit conversions in BoilerplateLang with .into() 😄
That's not the issue
The issue is that rules for implicit conversion are stupid, not implicit conversion itself
I think they work fine
I love implicit conversions and not having them in Rust is a major PITA for any refactor-like task
Again, not implicit conversions are the issue just the rules
Do you have an example of what bothers you?
Mom
That's a very German abbreviation 
Is it? ^^
Implicit conversion from int to bool
Implicit conversion from char* to bool
Well, in English "mom" is short for "mother", not "moment"
This makes sense, because consider this pattern:
Any pointer is implicitly a bool, false if nullptr, true if not.
And?
And it makes thing easier
Except when it doesn't
int to bool... I might agree that the good of this outweighs the bad
But I think it's more a matter of compiler warnings, and MSVC for example does warn you when you're implicitly casting to a smaller type
It's primarily an issue with the builtin types
Actually I just double-checked, it does for things like long long to int, but for some reason not int to bool.
Well, if you really want you can always just make your own int type 
The issue is if you happen to pass something incorrectly to a function
I understand, I had this issue like once when I was just starting out with C++ and refactoring some code
but it was pretty easy to just make a = delete; overload to catch the offending call sites
on bool?
Yeah, something like this
Not every caller is offending ^^
Then it sounds more like you want some assert within the function itself to ensure all preconditions are satisfied?
Okay, I had a function (maybe templated) which took several types. I forgot char* and it took bool
Something like this, then
Hmm...
I can't actually find the code where this happened
And there is also the issue, that in general you should generally should declare constructors with one parameter integral parameter explicit
That's also legacy
Well, the explicit thing depends on what you want your class to behave like
Sometimes implicit construction of your class is desirable
Yeah, sometimes
Actually, I'd wager to say most times
In general not
I'm not gonna say that OOP in C++ is boilerplate-free because OOP has some inherit boilerplate
I just accept it because I find the benefits of OOP are good enough to warrant it
And having seen the alternative with Rust's traits... I definitely prefer OOP.
And even if you generally want implicit the default, the issue is. Accidental explicit throws a compiler error, accidental implicit compiles
Accidental explicit?
I don't think explicitly constructing something is ever a compiler error
If it's explicit and you got it wrong, it doesn't compile. If it's implicit and you got it wrong it compiles and does nonsense.
I don't really think that's how it works
Well the kind of wrong is different in both scenarios
I think the explicit keyword just says the constructor can't be called implicitly
Yeah
Like, this behaviour may be desirable for your use-case.
If it's not, just do this:
And now that callsite has a compile error
Pass a number to an explicit because, you expected implicit. You instantly get an compiler error. Pass a number but, that was wrong and it was implicit when you didn't expect it to be, it compiles.
tbh I don't really see the issue
It compromises type safety per default
I suppose, but it's easy to overwrite the default
When I was just starting out with C++, I had the same opinions as you
and I still disagree with some defaults in C++
but it's really not that bad
The language gives you all the tools
Still it's bad
And the defaults make it very convenient to write
If you want the extra compiler checks, you can enable them with a keyword
Still explicit as the default and implicit as override would be better
Yeah, maybe, but implicit by default makes more code work
old code
By default, the compiler doesn't try to say that you're wrong. It assumes you're right, because you're a fucking God walking among men for all it knows.
Obviously if one would change the default, it would be breaking
but if you want the compiler to, you can very easily ask it to do some extra checking for you.
And ultimately, I've come to love this approach
because I started out exactly with your opinion lol
Or maybe it's just Stockholm Syndrome kicking in after all these years of C++ 
^^
It's not, that it's a deal breaker
But stuff like that accumulates over time
Like >20 years
The standard library also is a bit inconsistent
Well, most of the code I write looks like this
explicit on most ctors; [[nodiscard]] on most non-void functions
This is me asking the compiler to enforce a more explicit code style
Well yeah, also that was my point. You more often want explicit then not.
You know what I hate about C#?
using
I definitely agree that explicit would be a good default, but it's also not the worst thing in the world that it's opt-in rather than opt-out
Hahaha, old syntax. But yeah
Poor GC langs
Seriously, that crap drove me mad. The moment I noticed I had MEMORY LEAKS left and right
It's not a memory leak if it gets cleaned up Eventually™ 
Because I used bitmaps and bitmaps are unmanged memory and the GC didn't release it automatically. Just went OOM.
Oh no lol
It's nice to have a garbage collector, but still I need to manually manage my memory
And need to probe every object whether it's disposable or not
I don't find GC to be nice because most of the time RAII "Just Works™" and GC is just such needless overhead to do what RAII could do
Got one of my acquaintances to get a Wooting keyboard and when he uses the Analog SDK with the Wooting Analog Plugin, it seems to disconnect his Wootility. It's fine with my replacement plugin written in C++. The wonders of the Rust codebase. 
It could be down to the additional string requests that hidapi triggers
Definitely. The rust plugin with all my patches I compiled for him seems fine.
Still waiting on the hidapi-rs maintainer but then I can PR my final patch
So Rust is such a hard to use language that I couldn't get my PR quite into a state that compiles, I spent way way too long on it. I'm sure one of you guys that understands the arcane ways of this esoteric language could polish it up.
C++ rewrite when 
Tho in seriousness, I don't quite get why a language as immature as Rust was chosen over C++, when the codebase was already in C and all you had to do was change the feature flags on your compiler and start writing better code.
I think the main issue with getting logger to a custom sink would be that plugins, such as the "Wooting Analog Plugin" have their own/independent logger instances, so this is just gonna cut through the entire chain basically
I would probably want to focus on getting Rust plugins ported over to using the C ABI first to make them more robust, and to streamline it in general.
Then maybe considerations like logging can be done
But for me personally, when all my patches will be merged and published, I won't feel the burning urge to rewrite it in C++ anymore, and then... unicorns?
Oopsie, looks like something I did was not quite desirable for Wootility

My guess, his keyboard config got trashed because he used the configuration interface while Wootility was running
I sent some funny data to the keyboard itself regarding the key mapping and broke FN 2 & FN 3 layers, but got it fixed
Yeah POSIX and Windows both provide ways to load shared objects and resolve symbols from them.
One of these days I should make a system that allows me to create stub shared objects to MITM stuff to be able to check against reimplemented versions.
Shouldn't be too hard? Just enumerate exports, codegen for each symbol, and compile
Of course, assuming C ABI. C++ and Rust ABI are gonna be slightly more... challenging to shim. 😄
Yeah but you also need to be able to handle arguments and returns in a reasonable manor.
return reinterpret_cast<uintptr_t(cc*)(uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t)>(func)(args.at(0), args.at(1), args.at(2), args.at(3), args.at(4), args.at(5), args.at(6), args.at(7), args.at(8), args.at(9), args.at(10), args.at(11), args.at(12), args.at(13), args.at(14), args.at(15), args.at(16), args.at(17), args.at(18), args.at(19));

I mean just make a function that returns a uintptr_t (or void*), takes like 20 args, and just call the OG with all 20 args
This works absolutely fine with every calling convention I know
Ideally you'd be dumping all of the data from the arguments and return values.
Sure, but you don't know what that is. I mean, if you have more than just a DLL, but also a .h, you can be clever and cross-reference the exports with a function declaration. Then you can do more than blindly passing around register-sized data.
You can also open it up and view the assembly.
I wonder how that handles floats and extra wide stuff like SIMD values.
Hmm, I've not looked at how calling conventions handle the XMM and YMM registers
It's not been an issue for my work, including FFI stuff, so it's probably just fine
Yeah, just checked. It just puts pointers to the values in the respective registers.
Which makes sense. That's how it handles all types greater than 64 bits.
Although that's not correct. I have some custom types that fit in 64 bits or less, and it still uses pointers because the compiler is a little twat that doesn't like optimising my code.
Huh, funky.
You'd think it would want to use the extra wide registers where possible instead of using memory.
Well, tbf, it's pointers to values on the stack in the worst case
Yeah but that's still a trip to cache.
It just does so for interoperability with the calling conventions
because we can do shit like that without any respect for the underlying types
so the calling convention has to account for that
You can't just bend the calling convention based on argument types
(Well, you can, but at your own risk.)
It just feels like one could define a calling convention that accounts for such HW features.
One could, but wanna know what compilers do when it really matters?
They just don't call the function at all 😄
I had to define __declspec(noinline) to figure this out
because it would just inline it all
Yeah things get inlined and deleted and transformed.
Only works when the contents of the function is known though.
Escape analysis is really freaking cool too.
It makes sense, tho. In this case the function is about as big as the callsite would be.
"You pass this thing with like 20 bytes of memory but only use an int from it? Okay we'll only use that small part and inline code for you."
Sometimes the compiler is really smart at optimising code. Other times, not so much. Better to write code under the assumption that the compiler is a toddler.
Trust but verify.
One thing that bothers me is that LTCG is pretty damn limited, so you're better off putting important code in .h/.hpp files anyway.
And no way for me to (portably) inline ASM code when there's no intrinsic 
static inline
my beloved.
Luckily, there is a lot of intrinsics
What I hate about this is how both keywords have multiple meanings depending on context
Intel® Intrinsics Guide includes C-style functions that provide access to other instructions without writing assembly code.
How so?
🤔
It's a shame that a common Panama code pattern makes the JVM not optimize some code the way it should in Java 22, it breaks the escape analysis. :-/
In the context of a class, static means "static member". In the context of a compilation unit, "static" means "this symbol is not the same as other symbols of the same name in different compilation units", and in the context of a function, "static" is used to declare static initialisation of a variable.
Oh yeah I forget static inside functions.
That's pretty much the same as the class one though?
Not at all
that means "this has no this-pointer/can be used without an instance"
And "inline" means "please prefer to inline this function" and "this symbol can be present in multiple compilation units"
How is it not, it will only ever be the one variable.
I mean, it might be the same concept in your worldview, but to me, it's just a vastly different concept, and also has vastly different impacts on the generated code
void func() {
static int thing;
}
class Thing {
static int thing;
};
are pretty much the same use for static.
Except one of them generates vastly different code
That's so weird.
Practical example:
It doesn't need to do any of this initialisation dance for a static member because a static member just exists
(Although I guess it may need to anyway, depending on what kind of static member it is.)
I wish godbolt worked on mobile.
"Request desktop page"?
Because backspace means "copy and paste a random thing into a bunch of new lines."
wtf
The carrot is also always at the end, the keyboard doesn't like to show up, you can't select text to copy and you can't paste.
I don't know what they are doing but it's not great.
PC masterrace 
More like "using JavaScript to reimplement browser features never works as well as the browser itself."
FTFY
Hey sometimes JS is actually useful, it's just used for the wrong things 99% of the time.
I used to do web dev back in the good ol' days when jQuery was the biggest framework (and it actually solved real problems!)
It's weird, in another guild there's someone that loves JS and Rust but despises things like C, C++ and Java.
Nowadays I'm so tired of the garbage language that JS is, and all the frameworks around it
And I'm very happy with my C++ work
I also get paid a lot better now, but that's only tangentially related :^)
Weird. Maybe need to learn more skills/tools/languages/whatever?
Heck even the minimum wage sorts of positions don't want me for some reason. .-.
I keep trying Rust but it's just impossible, Go is pretty okay it just has bad error handling, I'm decent at C and I know a little C++, I'm really good with Java and I keep up to date on each release, I know Linux and Windows (but that's getting outdated from Microsoft doing weird crap), I've written some bash and Lua scripts, I'm not afraid of assembly it just takes me a bit, I'm definitely missing a lot.
Seems like a good variety
If you're comfortable with C++ and/or RAGE Scripting Language, why not work on GTA VI? 
(Or a new Bully game, where they might use Lua for game scripts.)
I've never heard of RAGE Scripting Language.
None of those are anywhere near me.
Eh, you kinda need that sort of thing if you want something like Lua.
maybe
Apparently the Roblox Lua engine is absolutely insane.
Well, it's some Lua 5.1 based fork
That kinda diverged from Lua over the versions
and it still has GC 
From what I heard they have a custom runtime that has a really good JiT or transpiler.
Yeah they apparently do have a JIT
My version of Lua also has a JIT, it's called "My CPU's cache"
it's actually insane how much faster VM code runs when it's not a cold boot lol
It's unfortunate that most contemporary programs can't fit entirely in the cache of modern processors
Modern C killers be like: 100MiB hello world.
Every time I touch someone else's Rust project it is so weird to have it download 200 different dependencies. .-.
I love my little C++ apps that are like 1,5 MB and constantly take up 0% of my CPU
Just write it, compile it, put it in autostart, and forget it
I do want to make a C++ service that has decent scope one of these days.
I did this funny little thing so I could have RGB from games on my Wooting keyboard (currently in GTA V)
I just need to figure out how I want to make it work the way I want it to, which is harder than it should be.
I need to figure out a better UI approach than hosting an HTTP server on localhost
but it works I guess
It's a thing that's going to need to talk to the currently active program among other tricky things.
What do you want to make?
Weird custom HID user space drivers.
Couldn't you use a unix socket/named pipe and a CLI thing? 🤔
I'm insane so I'd probably do that with a Swing UI.
Probably could, but meh
I don't think I understand
It's supposed to be a libusb based thing that sits in the background.
What problem(s) are you trying to address with this?
I do wish it wasn't such a pain to get a root dialogue without doing evil stuff like asking for the root password yourself.
I want custom stuff to give me physical buttons for more IDE features without having to press five keys or define even more keyboard shortcuts.
Probably other system control stuff too.
So, you want a Wooting UwU and use DKS to have it press keys for you? 😄
For who? 
Maybe also Wootomation could help here idk
Or you can go insane, like me: https://github.com/Sainan/uwu-code


