Thread #108612743
File: 1_-ShhxZjzzONtDF9MODGHgg.png (97.1 KB)
97.1 KB PNG
Which way, sperg man?
91 RepliesView Thread
>>
>>
>>
>>
>>
>>
>>
File: 1773901945868897.jpg (583.2 KB)
583.2 KB JPG
none. arrays in runtimes are sets of pointers to arbitrary var types, there is no point to apply this tinkertroonerism.
the better way for the runtime is to.. is to ask /opensourceclub/ at telegram, if you want to know.
>>
>>
>>
>>
>>
File: Picture_2_c.jpg (4.9 KB)
4.9 KB JPG
>>108612932
truly epic bait
>>
File: golang_genesis.jpg (38.6 KB)
38.6 KB JPG
>>108613619
>>
>>108612932
did you know that gotard devs spent years selling lack of generics as a "muh simplicity feature", which made them the butt of jokes over that period. then they said: okay, let's consult some real experts on this, javatards. lol. needless to say, that made them the butt of even bigger jokes since they somehow managed to tard-maxx further.
still, go is the less retarded of the two, which is still not an achievement. it could have been possible to argue that it's even good, in a world where this false dichotomy... wasn't false.
oh, and btw, YWNAA (you were never an aryan).
hope that helps
>>
D's way: f(T)(T x)
>>108612948
>>108613511
>>108612805
absolute retards
>>
File: hn_go.png (6.5 KB)
6.5 KB PNG
>>108613692
>gotard devs spent years selling lack of generics as a "muh simplicity feature"
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>108613692
but finally, it got troonified, hehehe
committee designs all end like that, it pushes absolute language slop into a compiler or runtime which becomes extremely bloated. why? because some trooner group of activists make an illusion of "public wants", "public needs", in fact, all those public likes are automated psyop, no different to those likes on github. slop in slop out
>>
>>
>>
>>
>>108613849
He's a dick, but he's also kind of right even if he's unhelpful about it. Can you tell me what you mean by "structure multiple locks in the same block without a loop"? Like, show me a small piece of Go code demonstrating what you mean.
I'm vaguely aware of how Go's channels work because I've used Limbo.
>>
>>108616730
> CLU and Ada were major inspirations for C++ templates.[5]
> Two distinct characters, each from Tron[citation needed] and Tron: Legacy[citation needed] respectively, are named after CLU.
tronified, hehehe
>>
>>108616678
an n-ary function signature requires n "->"s plus one "=>". i understand it comes from conceptualizing function application as chained partial applications of unary functions, but not providing a more compact way to write that is mental masturbation. i also hate double-colons.
>>108616786
underage b&
>>
>>
>>
>>108616831
plan 9 has a C function for it, called "alt" instead of "select"
https://man.cat-v.org/plan_9/2/thread
certainly more cumbersome than just having language support for it
>>
>>
>>
>>108616773
>>108616814
>>108616831
here an example found on Google (I am no go programmer).select {
case msg1 := <-c1:
fmt.Println("received", msg1)
case msg2 := <-c2:
fmt.Println("received", msg2)
}
This structured block[1] will lock and wait on two channels: c1 and c2. The first channel to be ready will unlock the structured block which will then continue at the right place.
[1] https://en.wikipedia.org/wiki/Block_(programming)
>>
>>
>>108612743template <typename T, typename Enable = void>
class Array;
template <typename T>
class Array<T, typename std::enable_if<std::is_arithmetic<T>::value>::type> {
T data[100];
};
Behold the power of the C++ committee. (This kind of shit actually gets shipped, btw)
>>
>>108616831
>muh select is impossible to implement outside the language
>what is "man 2 poll" :D
>>108616853
also "man 2 poll"
>>
>>108616945
Most types are abstract types like array, list, hash table, ... Only a fool and certainly not a programmer would accept to waste his time by defining types manually like array_float32, list_entity, ... when the compiler can handle that for us.
>>
in V:// goroutine 1: generate ticks at precise intervals
for {
select {
_ := <-cancel {break}
ms * time.millisecond {tickch <- 1}
}
}
}
// goroutine 2: send icmp echo requests
mut pk := [u8(8),0,0,0,0,0,0,1,0,0,0,0,0,0,0,0]
for {
select {
_ := <-cancel {break}
_ := <-tickch {
pk[2] = 0; pk[3] = 0; // clear checksum
t := time.sys_mono_now()
bin.big_endian_put_u64_at(mut pk, t, 8)
bin.big_endian_put_u16_at(mut pk, cksum(pk), 2)
s.write_to(a, pk)!
}
}
}
// goroutine 3: receive icmp echo replies
for {
select {
_ := <-cancel {break}
else {}
}
s.wait_for_read() or {eprintln("timed out"); continue}
t := time.sys_mono_now()
n, _ := s.read(mut &buf)!
hdrlen := 4*(buf[0]&0x0f)
printch <- Reply{bin.big_endian_u64_at(buf, hdrlen+8), t}
}
// main: print replies as they come in
for {
select {
_ := <-cancel {break}
s := <-printch {
// etc
}
}
}
>>
>>
>>108616902
>>108616975
>>108617010
What the fuck am I reading?
>>
>>
>>108617010
Meant as a response to
>>108616861
>>
>>108617027
As for the middle post, that's SFINAE. Basically, C++ templates are so fucked up, you can actually use them to do metaprogramming and type constraints.
The bad part is that the compiler has no idea what you're trying to do so if you do anything wrong, the error messages are beyond incomprehensible, it slows compilation to a crawl and the syntax is so ass-backwards that it makes you want to kill yourself.
Which means, you can't tell it apart from the parts of C++ that were actually intentionally designed.
>>
>>
>>108616814
>an n-ary function signature requires n "->"s plus one "=>"
>but not providing a more compact way to write that is mental masturbation.
Not at all. An n-ary function takes an n-tuple.someFunc :: (a, b, c) -> d
In most cases n-ary functions overlap in behavior with curried functions with n constructions, but a curried function isn't really n-arity and it doesn't behave that way. There's a small amount of syntax sugar to make it easier to write curried functions because point-free style is important for functional programming, but even the syntax sugar doesn't elide the two. I can't blame you for not knowing this though, many Haskellers aren't well versed enough in the runtime to know when to use a real n-ary function, so they just always stick to the normative "everything is curried" paradigm.
>plus one "=>"
No more noisy than <> or [] imo. Also unlike the two others, you can also completely do away with it if the type constraint is expressed in a GADT. Afaik, you can't alias a typeclass like that in Go or Julia? I might be wrong on that.
>>
>>
>>
>>
>>
>>108617042
many languages manage to do this without shoving it into the language (which forces one implementation onto you, but you already lost if a runtime is already shoved anyway).
this functionality exists at the syscall level. so you can wrap it in any language anyway.
if it wasn't for the full lack of low-level knowledge, some people would have picked on that already.
>>
>>
>>
>>
File: r_78064_8ZNye-2020157682.jpg (74.2 KB)
74.2 KB JPG
>>108612743
fuck java. anyone who is an enjoyer has never shipped fucking anything in their life. with go you get a nice native binary. with java you have to send a fucking xml to configure the jvm to not suck dick and you have to install the jvm on any desktop or server that uses it. people thing javascript is bloated... java requires gigs of jvm just to run a hello world.
>>
>>
>>
>>
>>
>>
>>
>>
>>108616902
>>108616831
It's just an monad interface, really. Haskell has TChan for this particular usecase of channels.do
msg <- atomically $
(Left <$> readTChan c1) `orElse`
(Right <$> readTChan c2)
case msg of
Left msg1 -> putStrLn $ "Got: " ++ msg1
Right msg2 -> putStrLn $ "Got: " ++ msg2
With c1 and c2 both as type TChan String
Of course, you won't really be able to use Either if you have more than 1 channel, but I just wanted to match the style using a pattern match.
>>
>>108616886
System Fakup! hehehe
nice features there, Trontards
>>108617007
> nocoder unable to implement ArrayFloat32
capitano obviouso
>>
>>
>>
>>
>>
>>
>>108617245
>putting the concept of goroutines and channels into the language allows very fast channel operations
relative to the complexity of the compiler
it does limit what kind of channel paradigms you can use though
>>
>>
>>
>>
>>108617490
>>108617495
provide a concrete example and let's actually measure, or are you a nocoder?
>>
>>108617629
measuring implementations doesnt make any sense for a language, the language is either sound linguistically or not, look:
function <-- pass
func <-- fail
fn <-- fail
no more measuring required for syntax.
>>
>>