|
javascript also has the triple equals, for when you really want it equals e: they do completely different things, === in js exists because js is bad
|
# ? Jul 27, 2018 12:47 |
|
|
# ? Oct 13, 2024 01:50 |
|
it's really cool that for some reason when otherwise reasonable programmers get into that FP Good poo poo they suddenly forget all about the concept of "reasonable function or variable names" or "comments" and nobody's expected to blnk an eye
|
# ? Jul 27, 2018 12:54 |
|
FormatAmerica posted:javascript also has the triple equals, for when you really want it equals this is how terrible I am: when you open any script file in our solution vs will barf a load of warnings of "==, I think you mean ===" and I ignore them all
|
# ? Jul 27, 2018 13:06 |
|
Powerful Two-Hander posted:this is how terrible I am: when you open any script file in our solution vs will barf a load of warnings of "==, I think you mean ===" and I ignore them all
|
# ? Jul 27, 2018 13:25 |
|
Powerful Two-Hander posted:this is how terrible I am: when you open any script file in our solution vs will barf a load of warnings of "==, I think you mean ===" and I ignore them all i've got this but with "use single quote not double quote" in typescript.
|
# ? Jul 27, 2018 13:27 |
|
Powerful Two-Hander posted:this is how terrible I am: when you open any script file in our solution vs will barf a load of warnings of "==, I think you mean ===" and I ignore them all carry on then posted:i've got this but with "use single quote not double quote" in typescript. tslint autoFixOnSave is the setting you've been waiting for.
|
# ? Jul 27, 2018 13:42 |
|
Powerful Two-Hander posted:this is how terrible I am: when you open any script file in our solution vs will barf a load of warnings of "==, I think you mean ===" and I ignore them all yeah that's pretty terrible don't use == unless you absolutely have a reason to compare and allow javascripts weird type conversion rules to do their thing https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness
|
# ? Jul 27, 2018 14:00 |
|
Blinkz0rz posted:yeah that's pretty terrible otoh don't kill yourself fixing a bunch of terrible javascript that you didnt write
|
# ? Jul 27, 2018 14:19 |
|
MALE SHOEGAZE posted:otoh don't kill yourself fixing a bunch of terrible javascript that you didnt write faking your death and fixing JavaScript in Belize, tho
|
# ? Jul 27, 2018 14:23 |
|
down there they use CocaScript
|
# ? Jul 27, 2018 14:24 |
|
Luigi Thirty posted:down there they use CocaScript the p in p lang stands for peru
|
# ? Jul 27, 2018 14:25 |
|
Phobeste posted:it's really cool that for some reason when otherwise reasonable programmers get into that FP Good poo poo they suddenly forget all about the concept of "reasonable function or variable names" or "comments" and nobody's expected to blnk an eye it's because functional programming is just an excuse to never have to come up with names for your variables
|
# ? Jul 27, 2018 15:41 |
|
MALE SHOEGAZE posted:
watch this space. until then you could use FutureObj to store boxed futures 0.3 Futures, as all Box<F> where F: Future03 can be freely converted to a FutureObj. its useful! yesterday i got invited to be a maintainer of futures-rs, so thats cool i guess.
|
# ? Jul 27, 2018 16:22 |
|
tinaun posted:watch this space. until then you could use FutureObj to store boxed futures 0.3 Futures, as all Box<F> where F: Future03 can be freely converted to a FutureObj. its useful! e: I gave it a shot, it almost works but I'm stuck because it looks like you can only convert into a FutureObj from a Box<Future<Output=()>> (as opposed to Output=A)? that doesn't really make sense to me, hmm. quote:yesterday i got invited to be a maintainer of futures-rs, so thats cool i guess. that's awesome, i'd be extremely chuffed about that if i were you DONT THREAD ON ME fucked around with this message at 17:13 on Jul 27, 2018 |
# ? Jul 27, 2018 16:39 |
|
tinaun posted:watch this space. until then you could use FutureObj to store boxed futures 0.3 Futures, as all Box<F> where F: Future03 can be freely converted to a FutureObj. its useful! that's awesome I can't wait until I can actually use them
|
# ? Jul 27, 2018 17:08 |
|
also tinaun plz explain pinning tyvm
|
# ? Jul 27, 2018 17:47 |
|
MALE SHOEGAZE posted:nice! i'll give that a shot. you got code:
code:
|
# ? Jul 27, 2018 18:16 |
|
Blinkz0rz posted:yeah that's pretty terrible born to script type safety is a gently caress eval em all 2018 i am js man 410, 757,864,530 ignored warnings
|
# ? Jul 27, 2018 18:20 |
Powerful Two-Hander posted:born to script
|
|
# ? Jul 27, 2018 18:25 |
|
Powerful Two-Hander posted:born to script
|
# ? Jul 27, 2018 18:30 |
|
gonadic io posted:snip Oh I didn't notice this, let me try harder. e: yeah that worked, thanks! unfortunately since the future needs to be send that means I have to constrain some of the typeclass methods to also be send, eg for functor, the Fn(A) -> B function would need to be send. This would be fine if I could limit that requirement to the future functor only, but I don't think I can. e2: oh I think I can just use a LocalFutureObj instead. DONT THREAD ON ME fucked around with this message at 18:57 on Jul 27, 2018 |
# ? Jul 27, 2018 18:35 |
|
i have found an excuse to spend my friday at work writing rust
|
# ? Jul 27, 2018 19:43 |
|
If you don't like the default latex font just use lmodern sans, it's much better.
|
# ? Jul 27, 2018 20:30 |
|
hurray: code:
DONT THREAD ON ME fucked around with this message at 21:02 on Jul 27, 2018 |
# ? Jul 27, 2018 20:48 |
|
replaced a horrendously fragile mess of regexes with an antlr grammar today naturally the main outcome is that i am now aware that none of the inputs are actually well-formed
|
# ? Jul 27, 2018 20:58 |
|
Bloody posted:i have found an excuse to spend my friday at work writing rust tell us about your rust project
|
# ? Jul 27, 2018 21:04 |
|
it is a state machine that supports testing a system. it talks to a system over udp, and uses a couple threads to do so for reasons im actually encountering a cumbersome pattern right now in my state machine logic. steps in the state machine are a function of the current state and the time in the state. the state is an enumeration, but the time is a float. as a result, my match looks like: code:
(State::first, > 5f32) => Some(State::next) (State::first, _) => None but that doesn't work (obviously) is there a pattern i could be using here that does work? I'd like to be able to clean it up to much fewer lines
|
# ? Jul 27, 2018 21:45 |
|
Bloody posted:it is a state machine that supports testing a system. it talks to a system over udp, and uses a couple threads to do so for reasons code:
This is called a match guard: https://doc.rust-lang.org/book/second-edition/ch18-03-pattern-syntax.html
|
# ? Jul 27, 2018 21:53 |
|
Fergus Mac Roich posted:
you don't even need to include time in the match to have a condition on it in the guard: code:
|
# ? Jul 27, 2018 21:55 |
|
a ha! i was at the top of that page just now. thanks! i wonder if i could write a clippy lint to detect the dumb thing i was doing instead and recommend match guards...
|
# ? Jul 27, 2018 21:55 |
|
gonadic io posted:you don't even need to include time in the match to have a condition on it in the guard: rust is awesome.
|
# ? Jul 27, 2018 22:01 |
|
Fergus Mac Roich posted:rust is awesome. standard haskell feature to the point where this became a way to avoid a huge chain of if-else blocks: code:
gonadic io fucked around with this message at 22:11 on Jul 27, 2018 |
# ? Jul 27, 2018 22:08 |
|
I think most functional language that have pattern matches and guard sequences for them support that feature.
|
# ? Jul 27, 2018 22:09 |
|
MononcQc posted:I think most functional language that have pattern matches and guard sequences for them support that feature. yeah, but are those languages zero cost *and* fearlessly concurrent?
|
# ? Jul 27, 2018 22:14 |
|
haskell is more "a cost between 2x and 2000x and you can't know ahead of time which it'll be" and trivial concurrency
|
# ? Jul 27, 2018 22:16 |
|
before i'm done with my functional rust library thing i'm definitely going to try and benchmark it against at least scala. interested in memory performance as well as speed. i'm trying to implement trampolining now and am curious to see how that performs against scala in a fold right.
|
# ? Jul 27, 2018 23:00 |
|
zero cost functor idea:code:
|
# ? Jul 27, 2018 23:06 |
|
Phobeste posted:it's really cool that for some reason when otherwise reasonable programmers get into that FP Good poo poo they suddenly forget all about the concept of "reasonable function or variable names" or "comments" and nobody's expected to blnk an eye i was trying to read the f# compiler source today because i was curious about something and idk if compiler code is always terrible or i’m really just that much dumber than don syme but oh lordy it was utterly incomprehensible
|
# ? Jul 28, 2018 02:01 |
|
raminasi posted:i was trying to read the f# compiler source today because i was curious about something and idk if compiler code is always terrible or i’m really just that much dumber than don syme but oh lordy it was utterly incomprehensible Some of column a, some of column b
|
# ? Jul 28, 2018 04:27 |
|
|
# ? Oct 13, 2024 01:50 |
|
jit bull transpile posted:I have an actual product idea but it would be subscription based and I'd want to HQ in Milwaukee instead of the stupid sf bay so it's doomed from the start probably. make the HQ in MSP and i will work for you. and/or i will be an unpaid hype-man because i do not have actual job experience touching codes i suggest this because wisconsin is still a bit atm
|
# ? Jul 28, 2018 04:32 |