« first day (3562 days earlier)      last day (1369 days later) » 

3:27 AM
Ok, I finally wrote a prototype of how to control servos on Arduino through a raspberry Pi.
It's easier than I thought. Thanks to someone in our last A.I. in Robotics meetup who gave me the concept.
 
3:54 AM
I'm bored of writing, anybody doing anything cool?
 
4:06 AM
Anybody know how to disable automatic inking in Office 365? The mouse keeps changing to the pen causing random marks and other junk in my manuscripts.
 
 
1 hour later…
user7659542
5:30 AM
Was told by a senior engineer asm is very usefull because you ll almost always be able to write code which is better than the one generated by your compiler
 
user7659542
because you know exactly what your code and product is supposed to do and what things are unlikely to happen. So you can optimize for that
 
user7659542
WHat are the chances one is able to write better asm code than the one generated by your compiler?
 
It happens a lot but not quite from using ASM. For example, using MSVC AVX intrinsics (hell they don't let you use ASM) you can often come up with something better than the compiler.
Hell MSVC doesn't have any unsigned short code paths for SIMD optimization which is insane.
That being said, these aren't typical scenarios.
Also consider this scenario. You're a hot-shot coder who writes some super fast SSE routines. 5 years later you get beat by AVX512 generated by the compiler.
 
Deciding to share this:
https://gist.github.com/LapysDev/fe54e3047e3ac389ef88fbc85c9d1e72

It's a line drawing algorithm I came up with.
Obviously it's not the best and it's not a proposal for a new algorithm or anything
but it is something I thought would be nice to share.
 
5:49 AM
would be more interesting if you had some example pictures and a comparison to other methods
 
user7659542
@Mikhail seems like I have some reading to do about "MSVC AVX", never heard about that...
 
user7659542
What's the difference between:
 
user7659542
 __asm__("BIT.B R2, 3");
 
user7659542
and
 
user7659542
__asm__("BIT R2, 3");
 
user7659542
5:51 AM
latter does not compile. It says: Error: odd operand: -3
 
@Mikhail True, I'll take note next time
 
10
A: Speedup a short to float cast?

MysticialHere's a basic SSE4.1 implementation: __m128 factor = _mm_set1_ps(1.0f / value); for (int i = 0; i < W*H; i += 8) { // Load 8 16-bit ushorts. // vi = {a,b,c,d,e,f,g,h} __m128i vi = _mm_load_si128((const __m128i*)(source + i)); // Convert to 32-bit integers // vi0 = {a,0,...

 
The line drawing algorithm is dependent on ratios...

The ratio of how much `x` is updated with regards to `y` up to a count e.g.: 90 degree line has a ratio of `1:0` where `x` is incremented unit-by-unit and `y` is not updated (incremented by nothing)
 
user7659542
6:23 AM
@Mikhail MSVC = microsoft visual studio c++?
 
:-/
 
user7659542
SSE and AVX seem to be smth quite esoteric. An esoteric ISA.
 
user7659542
ie something with which not many devs will be confronted
 
Nope, half the time memcpy maps to them.
Just cause you don't know about it doesn't mean its esoteric!
But now you know.
 
user7659542
didn't say that because I didn't know about it. It s just because it, at first glance, looks to be very specific
 
6:26 AM
I mean in the chat somebody recently posted Linus's rant about AVX
 
user7659542
and I have worked at quite some companies and never heard about it neither
 
user7659542
@Mikhail lol, looks like I should try to find it
 
As I wrote earlier this rant is self fulfilling, and Windows's doesn't seem to struggle with AVX.
 
user7659542
Also, I work on ARM quite often and I don't think that's a think on ARM
 
ARM has something similar, and I've had to deal with it on Android in undergrad.
 
user7659542
6:27 AM
Sandy Bridge architecture and therefor AVX and such are for intel
 
user7659542
@Mikhail thx
 
user7659542
@Mikhail any idea what ARM's equivalent would be?
 
When I was a kid it was NEON
 
user7659542
Ooooh!
 
A lot of graphical effects use this so if you dissemble GUI libraries you see this stuff all the time.
 
user7659542
6:29 AM
I ve met quite some people who searched for engineers who master NEON. Always said I should look into that, but have not had the chance yet
 
user7659542
@Mikhail Undergrad? I remember first year at uni, we were supposed to program an interrupt and timers in asm on 8051. But no NEON stuff
 
user7659542
where did you study? MIT?
 
UIUC
 
user7659542
30k/year
 
Its more now
But I didn't pay that
 
user7659542
6:31 AM
at that price I do indeed hope you re a mfcking expert by the time you graduate
 
user7659542
asm, NEON, senionr C++ engineer, etc
 
user7659542
I paid somewhere around 3-4k in total for my 5 years of studies at uni
 
user7659542
my uni is amongst the world's top 50 according to the internet
 
user7659542
so I guess that's not too bad. 3k -> top 50
 
1) Its less if you're in state or independent, I paid by whoring myself to the PhP gods 2) Most people took out loans and indeed paid them back within 5 years 3) its cheaper than CMU which I couldn't afford 4) reasonable compared to American schools 5) I skipped all my classes and focused on doing projects instead
The school is designed to land you a job at those FANGs which then train you. Those kids can barely code coming out of the school.
 
user7659542
6:36 AM
you focused on doing projects rather than giong to classes? Are you the kind of person who gets hired by a top company while being a student?

When working abroad, there were kids at a big uni who never went to classes, because they were working for big European firms and earning European salaries
 
user7659542
apparently those kids were very talented
 
Linux wasn't just ranting about AVX in general, but more about AVX-512 specifically. It's pretty clear that even Intel isn't convinced it was a great idea and seems to randomly remove or add it from their different product-lines
*Linus
 
Everybody got hired by a "top company" then they got trained at that company to code
 
AVX-512 specifically is such a mess with a bunch of different variants for such a niche instruction set to begin with
 
user7659542
@Mikhail honnestly... Do you really become an expert coder if you get trained by a FAANG company?
 
user7659542
6:37 AM
what s their training worth?
 
@PeterT They've been actively trying to cut all floating point out of the kernel.
 
user7659542
how do they "train" people? Just giving random tasks with increasing complecity?
 
@traducerad First off you get paid a ton while you're training. I think you become a very different coder than the stuff I do which can be described as making tons of prototypes. I'm often the only coder. There is a lot of discussion about this in the chat (mostly by me talking to myself).
@traducerad Sometimes they have classes. Also extensive code review. Also a year on-boarding isn't unusual.
 
user7659542
what are extensive code reviews like?
 
user7659542
Some of my colleagues get pissed when they need to peer review code and it takes more than 30 minutes-1h
 
user7659542
6:39 AM
which I find proposterous
 
I'm sorry I only know about it second hand. A few people who used to frequent the chat worked at Google for example.
 
user7659542
IMO a good peer review could take 1-2 days
 
user7659542
depending on the amount of code, obviously
 
user7659542
@Mikhail I see
 
I mean, for new students I don't let them commit anything without review.
This is also why the kids from UIUC aren't senior developers, they just are consumed by well paying companies.
 
user7659542
6:41 AM
I would not let anybody commit anything into the master, without peer review
 
user7659542
even if you are a senior or the architect
 
Hmm, I kinda let people do that :-)
 
user7659542
@Mikhail ne-ver.
 
Yeah, although I think its different if you make products that are allowed to crash :-)
 
7:06 AM
@PeterT The weird part is somehow it seems like supporting AVX512 shouldn't be too expensive if you already support AVX256 as you can emulate 512 operations if you have the 256 register file (and emulating them might reduce IPC). I actually think its a fuck up due to Intel's marketing positioning. Like "you gotta pay more for this!".
 
if you're emulating it with avx256 ALUs anyway then it's a waste of everyones time to expose that as a separate instruction set
 
would reduce instruction overhead, but also it would encourage people to write code for higher-end devices
What I always dreamed of was a way to upgrade AVX on the fly :-)
Then maybe CIV 4 would run faster
 
wasn't there some silly "arbitrary length SIMD" thing for PPC
 
Yeah, but AltiVec made photoshop run a bit faster. From what I recall IBM has something called VMX.
 
 
4 hours later…
10:54 AM
@Mikhail no you can't, the AVX512 register file is 16k worth of silicon
it's 32 registers
@traducerad lol bull
 
11:07 AM
@PeterT RISC V has that, you go into vector mode and then tell the CPU how long to run the loop for
@PeterT not quite, the memory bandwidth saved from having the register file is fairly large
 
 
3 hours later…
2:01 PM
I would be surprised the only reason the AVX512 registers are 512 bits wide is so they have a simple reason to claim it's a better instruction extension
whereas if they had the instead made the same instructions work on the 256 bit wide registers (and avx256 2.0 if you will) things would have been a lot better
 
 
1 hour later…
user7659542
3:07 PM
@Mgetz disagree?
 
3:17 PM
@traducerad Unless the CPU has the world's most constrained cores and memory.. yes. Compilers are able to do things you wouldn't even think of to speed things up. EX: godbolt.org/z/bo49rf
@ratchetfreak IMO they probably had a persistent customer with a problem domain that fit into that very very well. Not all problem domains translate well to GPU even if they vectorize well
I'm honestly surprised that intel doesn't offer a xeon with a midline on cores and a lot of HBM to keep them fed
 
3:34 PM
Design to scale, optimize tight loops
Unless you're in HPC or really performance-sensitive stuff it's enough, you don't need to write any ASM
 
@Morwenn some embedded it makes sense, but even then it usually doesn't
 
user7659542
4:37 PM
@Mgetz O.o
 
user7659542
I didn't expect such an asm code
 
@traducerad exactly, the compiler knows more about the target than you do. It can do things you wouldn't think about for the same result.
 
user7659542
this also shows that CISC instruction sets are a bit of a pain to read
 
user7659542
I recently started learning asm, RISC. But could not understand those instructions
 
@traducerad not really? the sign extend is the only weird thing?
 
user7659542
4:39 PM
It s probably because I am not an expert at asm that it is a bit "harder" for me
 
user7659542
RISC is relatively straightforward to read
 
user7659542
not necessarily to comprehend though (unlike plane C)
 
user7659542
I am still stuck at properly understanding the difference between
 
user7659542
BIT.B R2, 3 and BIT R2, 3
 
@traducerad if I was to guess? width
 
user7659542
4:43 PM
well no
 
x86 indicates that generally with register name
 
user7659542
BIT tests to see if a given bit is 0 or 1 (if I understood it correctly) and tells you by setting/clearing the carry register
 
user7659542
buuut, I am confused about the fact that BIT.B R2, 3 compiles while BIT R2, 3 does not
 
user7659542
the compiler does not accept the last variant
 
4:45 PM
@traducerad which core?
 
user7659542
@Mgetz msp430
 
user7659542
I found some documents online listing the ISA's instructions, but this onbviously does not tell why something does or does not compile
 
@traducerad it's as I suspected
.B is byte and .W is word
 
user7659542
so?
 
user7659542
as said, I have (I think) a good understanding of HW and low level SW but just recently started with asm. So I don't quite see how this explains the fact this line doesn't compile
 
user7659542
4:54 PM
@Mgetz ok, just understood the sense of your answer... Yes, width is the difference between those instructions
 
@traducerad because the assembler doesn't have a default width. You need to tell it which instruction to assemble to
 
user7659542
in some cases it does work perfectly fine without specifying the width, eg
 
user7659542
int main (void)
{
  while(1){
    __asm__("BIT R2, 2");
  }

   return 0;
}
 
user7659542
this compiles perfectly fine, while if you replace the 2 by a 3 it does not any more
 
user7659542
in order to make it work when you specify '3', you need to use BIT.B
 
user7659542
5:00 PM
@Mgetz not sure this is the case
 
Dunno, as I said this was just a suspicion, a guess
 
5:41 PM
 
 
1 hour later…
6:49 PM
 
user1804599
7:12 PM
 
user image
2
 
user7659542
7:43 PM
@rightfold saying JAVA is nice because it works on every OS, is like saying anal sex is nice because it works on every gender.
 
user1804599
So it’s like saying the truth.
 
7:59 PM
I can see the buff doge coming back from just having written the code that was responsible for allowing the ILoveYou worm to spread
 
@traducerad Well, it is a nice property of anal sex
So your analogy is not that good :p
 
user7659542
dunno, I m not a senior anal engineer
 
user7659542
that's what s being told out there by the youngsters
 
9:22 PM
Discord seems down, back to the olde Lounge
Youngsters these days are young and woke
 
user1804599
Woke and broke.
 
Even us older millenials are often broke
Damn, is there a global internet issue? Discord seems down, MangaDex is extremely slow to load and Travis builds start failing unexpectedly
 
user1804599
9:39 PM
Yes, Cloudflare DNS is broken.
 
user1804599
Dystopian situation.
 
Damn, it's scary how thin the backbone of the internet can be sometimes
 
user1804599
Recently Twitter was haxxored.
 
I really need to start getting into decentralized WiFi networks to prepare for the apocalypse :p
Yeah, that Twitter thing looked like a shitshow
 
user1804599
If only instances could just block affected instances until the problem was resolved.
 
user1804599
9:41 PM
But nooo, t w o t t o r has to be centralized.
 
user406009
Haven't been back here in ages
 
user406009
Sorta hilarious how SO is more reliable than Discord
 
you can still Mastodon
 
user406009
Lol Mastadon
 
user1804599
Discord is written in Erlang, so it crashes all the time.
 
9:42 PM
Well, SO is quite light and doesn't have much traffic compared to Discord
 
user1804599
I use Pleroma. It is very nice.
 
user406009
The joke is that SO also has more features
 
Also the media sharing on Discord is way heavier with a super-high number of bots constantly interacting
 
user406009
Direct replies are such a godsend
 
tbh direct replies is the only feature that I really miss over there
 
user406009
9:43 PM
I just wish my stargazer extension still worked here so I could see who starred what
 
hi
 
user1804599
Oi m8
 
Hey, your extension is the reason your extension doesn't work anymore
 
i want to learn c++
how do you recommend i start
 
accept the pain
 
9:44 PM
lol
i learned assembly language
M68000
that's pretty painful
 
user406009
@Haversine I recommend getting a book
 
but what resources do you recommend i start with
ah
 
user1804599
I want to make a handy dandy unit-aware calculator with built-in functions for computing properties of electronic circuits and I need a name for this project.
 
/which book do you recommend
@lala
 
user1804599
There is a list of books on tinyurl.com/so-cxxbooks.
 
user406009
9:46 PM
4243
Q: The Definitive C++ Book Guide and List

grepsedawkThis question attempts to collect the few pearls among the dozens of bad C++ books that are published every year. Unlike many other programming languages, which are often picked up on the go from tutorials found on the Internet, few are able to quickly pick up C++ without studying a well-written...

 
@rightfold I missed you project names rambulations
 
user406009
Might also be worth looking at the top rated books on Amazon as well
 
ok thx
 
user406009
@Haversine Just make sure to use a book that's at least C++11
 
ok
is it worth my time to watch youtube videos?
 
user406009
9:47 PM
Are you already setup as far as getting a C++ compiler is concerned?
 
yes
 
user1804599
@Haversine No.
 
The very next step is to have projects, suffer and learn along the way
 
ok
i have visual studio
with c++ installed
 
user406009
The issue with youtube videos is that they usually don't have an long term agenda/syllabus. C++ is a complicated language and you really need a guided tour to the language
 
9:48 PM
I've never learnt programming languages through books or videos so I can't really be of any help there
 
where did you learn?
 
user406009
Yeah, visual studio is good. Make sure you have a reasonably recent version though
 
courses?
 
user1804599
Yeah just start writing programs and then ask for code review from people who know C++ well.
 
user1804599
Problem is finding those people.
 
9:49 PM
yes i have the latest
 
A bit in school, otherwise all over the internet
 
user406009
Perfect.
 
ah i see
so stack overflow
 
user1804599
Lounge<C++> used to be a great place to learn C++ when robor and sehe were still here.
 
Nowadays I mostly learn technologies on a need-to-know basis: when I've got a need I start a project with said tech, make mistakes, try to find best practices to fix them and learn along the way
 
user406009
9:50 PM
@Haversine Once you finish your book, abseil.io/tips is another great learning place
 
It's most likely not a good method to learn from scratch
 
user1804599
Any time I posted something wrong about C++, I would be immediately scolded and corrected, which was very helpful.
 
@sehe is still around
Oh right, internet chatrooms can help a lot to get redirected to solid advice or articles
When I learn Conan a few months ago, the guys on the cpplang Slack were incredibly helpful
 
user406009
Now you just got to learn Bazel. The One True Buildsystem
 
plz no
 
user1804599
9:53 PM
Learn Snowflake.
 
The version lockdown of Google's libraries is plain horrible
 
user406009
Bazel is like alcohol. If it isn't working for you, you aren't using it enough
 
user1804599
 
When you need to use a heap of 100 libraries like I had Bazel really was the one annoying tech to integrate
 
user406009
@rightfold Just saw perl and noped out of there
 
user1804599
9:53 PM
You’re missing out.
 
user406009
The trick with Bazel is that you need total buy in
 
@Lalaland that's a bad reason
 
user406009
The whole world has to be built in Bazel
 
I didn't have time to reimplement a whole ecosystem at work
I'd say fuck Bazel
 
user1804599
Bazel is nice if you get all dependencies using Nix, completely ignore the dependency downloading part of Bazel, and are able to tolerate Skylark.
 
9:55 PM
If your build tool doesn't adapt to the existing libraries and build systems, then it doesn't scale when you're working for a company and don't have the time to reimplement the world
 
user406009
I view Bazel the same way I view Haskell
 
user406009
A work of art to be appreciated from afar
 
At one of my previous jobs I had to handle a library heap that had Qt, Boost, VTK, ITK, Tensorflow, OpenCV, all their dependencies, and a bunch of others
 
user1804599
Nix is great for managing external dependencies.
 
Yes afar is the word, it better stay far away from what I have to do x)
 
user1804599
9:57 PM
It works out of the box with GNU Autotools, Ninja, and CMake.
 
what about discord servers
are those good chat rooms to learn c++
 
@rightfold now those are strong selling points
@Haversine C++ Help might help
 
user1804599
I upgraded my desktop computer from Windows 10 to GNU/Linux recently and now I can finally use it for day-to-day tasks.
 
user1804599
Typing on Model M is so much nicer than laptop keyboard.
 
Is it the new Tesla
 
user1804599
10:01 PM
It’s much better than that.
 
user1804599
 
Is it a bent keyboard
 
user1804599
It has a curved slope.
 
user1804599
I have it at work and at home and it is really nice.
 
user1804599
I wish I got the version with a super key though.
 
10:09 PM
I still only have my laptop ^^'
 
@Morwenn check. Rarely in the lounge though
 
Too bad, I'd love to see more activity again in this room :)
Ah, but I should participate more myself then
 
10:39 PM
tfw I kill mosquitoes but there's ever more
fortunately they apparently don't transmit SARS-CoV-2
 
user1804599
Haven’t had issues with mosquitoes since two years.
 

« first day (3562 days earlier)      last day (1369 days later) »