Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Cybernetic Vermin
Apr 18, 2005

outsourcing is p. symmetric, india is not getting outsourced dev work, they are outsourcing management to americans with the right sense of entitlement

Adbot
ADBOT LOVES YOU

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

uncurable mlady posted:

yet for some reason no one ever comes up with the bright idea of outsourcing management

huh

they're called "general contractors" when building a house, I guess.

the problem is that, as the parasitic leisure class of software development, we managers produce no valuable artifacts, so we'd never get paid.

15 hours: read developers' bugs recording errors to keep their performance reviews mediocre
10 hours: reading about how to dress and speak in order to get my boss's job
5 hours: sending email to distract developers with process changes and requests for status
15 hours: meetings with other managers where we just play on our iPads and complain about our wives

josh04
Oct 19, 2008


"THE FLASH IS THE REASON
TO RACE TO THE THEATRES"

This title contains sponsored content.

i'm doing a ~swift~ tutorial and the instructions just told me how to implement Hashable, there must be a hash method and a == overload. it proceeds to not use the hash method in the ==. twice. am i missing something?

pseudorandom name
May 6, 2007

why would you use the hash in the equality operator?

Shaggar
Apr 26, 2006
idk about swift but in java hashcodes don't have to be unique. objects that are equal should always have the same hashcode, but objects that are not equal can have the same hashcode or different hashcodes. because of this you cant trust hashcode for testing equality.


however, assuming you wrote a unique hash algorithm for your class (don't assume this) then yes you could compare hashcodes to test for equality. but then you have to worry about the performance of your hash since it might be slower than doing the equality some other way.

so the tradeoff in the hashcode contract is rare collisions are ok if we speed things up because we have equals to test for real equality if we need it.

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

pseudorandom name posted:

why would you use the hash in the equality operator?

if the hashes differ, you don't need to compare the data

sarehu
Apr 20, 2007

(call/cc call/cc)
But you had to walk the data already (entirely) to compute the hashes, so you'd rather be able to compare the data.

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

sarehu posted:

But you had to walk the data already (entirely) to compute the hashes, so you'd rather be able to compare the data.

yeah, yeah of course :ughh:

I was thinking of immutable objects where you only calculate the hash once

pseudorandom name
May 6, 2007

the answer to the question that wasn't asked is you need an equality operator because any situation where you'd use the hash code you'd need to verify equality anyway

Vanadium
Jan 8, 2005

i'm finally reading about futexes and they seem pretty cool. and i'm happy to stop thinking of userspace concurrency primitives as magical, or trying to guess which one is the fundamental abstraction that the others would be implemented on top of. but wow everything around that sort of concurrency seems super subtle and fragile and the domain of wizards anyway.

Vanadium
Jan 8, 2005

(i don't really dare think about how kernel space scheduling works)

pseudorandom name
May 6, 2007

futexes are so neat Microsoft added them to Windows 8

fritz
Jul 26, 2003

futexas
futaxes

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

fritz posted:

futaxes

is what I see

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av
*hackbunny-sense is tingling*

pseudorandom name posted:

futexes are so neat Microsoft added them to Windows 8

weren't they introduced in vista? or at least it was the first time they introduced keyed events (and used them to implement tons of pthread-like primitives like condvars). did it get expanded in windows 8? I'd love to read about that

I still doubt they are as cool as they are in linux: you can make them inter-process by allocating them in shared memory, because they are identified by virtual page + offset, whereas windows just uses the virtual address. from what I remember of the windows vmm (ie. not much and it gets rewritten on every major release anyway, gently caress the windows vmm hard), it's probably not impossible but absolutely hellish to do the same in windows

Workaday Wizard
Oct 23, 2009

by Pragmatica
uɐʇɐs lᴉɐɥ

Vanadium
Jan 8, 2005

is there any non-lisp with a good macro system that i can rub the rust people's heads in

MononcQc
May 29, 2007

Define good macro system

Vanadium
Jan 8, 2005

yeah, #define is already probably better than rust's system

Dicky B
Mar 23, 2004

as usual the answer is nimrod

Zombywuf
Mar 29, 2008

What's up with Rust's macro system?

pseudorandom name
May 6, 2007

hackbunny posted:

*hackbunny-sense is tingling*


weren't they introduced in vista? or at least it was the first time they introduced keyed events (and used them to implement tons of pthread-like primitives like condvars). did it get expanded in windows 8? I'd love to read about that

I still doubt they are as cool as they are in linux: you can make them inter-process by allocating them in shared memory, because they are identified by virtual page + offset, whereas windows just uses the virtual address. from what I remember of the windows vmm (ie. not much and it gets rewritten on every major release anyway, gently caress the windows vmm hard), it's probably not impossible but absolutely hellish to do the same in windows

MSDN says WaitOnAddress/WakeByAddressAll/WakeByAddressSingle were added in Windows 8 and doesn't say anything at all about multiple processes or file-backed or shared memory addresses.

On the plus side, the API doesn't include a bunch of obsolete-because-it-was-racy options, and I'm assuming they didn't botch 32 versus 64 bit compatibility like glibc did with process-shared pthread mutexes.

pseudorandom name fucked around with this message at 00:49 on Oct 9, 2014

Vanadium
Jan 8, 2005

Zombywuf posted:

What's up with Rust's macro system?

concretely: their token-pasting is apparently broken because they added hygiene, but even if it wasn't you couldn't use it to actually name declarations because macros only go in declaration or expression positions, not identifier-in-a-declaration positions or anything, not even in the token tree that a rules-based macro returns. this is pretty easy in C, so it's extra frustrating.

also rules-based macros can apparently only splice a handful of syntax bits and not even all kinds of tokens into their result.

it's kinda stuck in a weird place where it's just barely too sophisticated to let you do all the weird stuff people do with the C preprocessor, but not nearly high level enough to let you do all the weird stuff people do with C++ templates.

other than that: the next step up from rules-based macros is full-on programmatic syntax extensions where you have to write a function that is dynamically loaded into the compiler and handed a bunch of internal compiler structures and wished good luck

both of these happen while/just after parsing, so there's also no type info or anything available to operate on higher-level concepts than tokens and ast nodes. there's special built-in magic for deriving a handful of traits, like in haskell, but you can't really build your own for your own traits.

afaik the one guy who wrote the macro system back in 2011 or 2012 or so occasionally shows up to fix weird bugs and I think added hygiene at some point, but otherwise isn't really with the project anymore and only drops in when someone says 'macro' in the irc channel. it's been in a permanent state of "we might come up with a better system so we won't commit so support current macros", but it's very likely to ship as it is for 1.0 (behind an opt-in "this is unstable" flag) and i don't think anyone has any enthusiasm to work on it

Vanadium fucked around with this message at 01:17 on Oct 9, 2014

Zombywuf
Mar 29, 2008

now having visions of people running their rust through gcc -E before compiling.

Vanadium
Jan 8, 2005

people do it with haskell, i wouldn't even feel bad

it doesn't help that the tool people use to generate rust bindings from C headers doesn't attempt to reproduce #defines at all, even if they're just integer literals or something

edit: apparently you can use the tool as a macro now, that's pretty cool i guess

minidracula
Dec 22, 2007

boo woo boo

Vanadium posted:

is there any non-lisp with a good macro system that i can rub the rust people's heads in
MetaOCaml owns bones in this arena (which is admittedly pretty small).

Maybe doesn't apply (ahem) because it's not in the core language? Whatever. I don't know if you care about that as criteria.

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

Shinku ABOOKEN posted:

uɐʇɐs lᴉɐɥ

JewKiller 3000
Nov 28, 2006

by Lowtax
who will snipe page 1000? we can only wait and see

Star War Sex Parrot
Oct 2, 2003

who cares

Bloody
Mar 3, 2013

who will gas this thread before 1k

tef
May 30, 2004

-> some l-system crap ->
let's get a new thread

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum

tef posted:

let's get a new thread

why it is pretty much the same recycled stuff

Stringent
Dec 22, 2004


image text goes here

tef posted:

let's get a new thread

programmers always wanting to rewrite poo poo

sarehu
Apr 20, 2007

(call/cc call/cc)
what do you people think about ethereum's programming language?

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

pseudorandom name posted:

MSDN says WaitOnAddress/WakeByAddressAll/WakeByAddressSingle were added in Windows 8 and doesn't say anything at all about multiple processes or file-backed or shared memory addresses.

aha thats cool, they made a win32 api for the keyed event. no its def not cross-process, keyed event is a per process singleton

technically its been in the kernel since vista, fe you can figure how WakeByAddressAll was used to implement WakeAllConditionVariable

still thats not a futex, its a sleepon lock, a seriously old school unix kernel synch primitive (only other os with an user mode api for it is qnx, iirc). a futex is tied to memory storage, not virtual address, and iirc its an actual variable the kernel can read/write. theyre a pretty unique thing e: whereas a sleepon lock is a low-overhead way to retroactively add synchronization without defining new variables, as in the synchronized/monitor pattern in java/.net/objc

e: nope, it's not even a sleepon lock, sorry, it lacks LockByAddress/UnlockByAddress. it's literally just a way to create anonymous events on demand

hackbunny fucked around with this message at 09:18 on Oct 9, 2014

Luigi Thirty
Apr 30, 2006

Emergency confection port.

so a futex is a lock with a penis right

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Luigi Thirty posted:

so a futex is a lock with a penis right

crit(sec)s with dicks

Soricidus
Oct 21, 2010
freedom-hating statist shill

Stringent posted:

programmers always wanting to rewrite poo poo
b-but we can do it right this time

and in my favorite language

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av
real programmers snipe page 1024

Adbot
ADBOT LOVES YOU

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

gas this thread

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply