|
if you mark intsToAges as inline, it'll probably be fused away and be free again. I agree that 'probably' is a problem, though. guarantees are nice. also what fix are you talking about? is it going to recognize that 'Age' is really just 'id' and rewrite away 'map id'?
|
# ? Jan 23, 2014 20:43 |
|
|
# ? May 18, 2024 09:08 |
|
coffeetable posted:was just adding in a reply to your edit, but yeah that's the thing. map/mapM/mapM_ is fine because anyone working in haskell knows what a pain state is and has had lazy evaluation drilled into them since day one. in contrast, the majority of .net devs probably dont know what a side-effect is, and all LINQ's laziness means to them is that they need to scatter some ToList()'s around to stop VS complaining yeah the vs devs are busy trying to write something worthwhile
|
# ? Jan 23, 2014 20:49 |
|
crazypenguin posted:if you mark intsToAges as inline, it'll probably be fused away and be free again. it should since newtype constructors should be no-ops iirc the "fix" is to prevent you from breaking the type system in half with newtypes, generalized nt deriving and type families
|
# ? Jan 23, 2014 20:53 |
|
crazypenguin posted:if you mark intsToAges as inline, it'll probably be fused away and be free again. https://ghc.haskell.org/trac/ghc/wiki/NewtypeWrappers posted:It should be possible to add REWRITE rules that turn, for example, map N into the zero-cost conversion from C T to C N so you'd have the function coerce which can be specialised to have type [Int] -> [Age]. this will (ideally) mean that your use of coercion can be checked to be valid at compile time. the automatic compiler stuff will be some later release i guess gonadic io fucked around with this message at 21:16 on Jan 23, 2014 |
# ? Jan 23, 2014 21:00 |
|
bang keys run code fix latercode:
|
# ? Jan 24, 2014 01:30 |
|
Gazpacho posted:i thought gpl 3 existed because rms spazzed out when he heard that people couldn't hack their tivos tbf i did get messed up by tivo pairing its web services api with an ssl certificate that expired a couple of years ago with no way to update it
|
# ? Jan 24, 2014 02:11 |
|
Shaggar posted:web 2.0 is dumb as poo poo, knockout just makes some of it easier. The cool thing about knockout is you don't have to fill it with ajax, you can have your server generate the javascript model and content and put it all on the page and then just let knockout handle things like adding dynamic fields and stuff. Legitimate stuff you would normally do w/ jquery but is still gay as balls javascript that you want to do as little of as possible. normally i disregard it when people talk shop about js frameworks because i hate js and i hate browsers. but when someone who hates js and likes actual good languages endorses knockout, i think i had better take a look gonna use knockout for my newest un-finish-able hobby project
|
# ? Jan 24, 2014 02:17 |
|
detroit posted:bang keys run code fix later it's...it's beautiful
|
# ? Jan 24, 2014 02:25 |
|
when you get promoted from junior dev at epic systems they pass around a loving cup
|
# ? Jan 24, 2014 03:02 |
|
Notorious b.s.d. posted:normally i disregard it when people talk shop about js frameworks because i hate js and i hate browsers. but when someone who hates js and likes actual good languages endorses knockout, i think i had better take a look i have the same feeling, i just started a project that i didn't really want to do a web ui for anyway but honestly writing the iOS app is going to be just as hard and i'm going to have to implement server calls everywhere so i might as well write the "cross platform" version first i wasn't going to do it because implementing this kind of thing in jquery looked like a pain in the rear end but knockout looks almost not-terrible
|
# ? Jan 24, 2014 03:10 |
|
Shaggar posted:haha so much linq abuse. linq is so cool. never doing a for loop ever again it's cool how resharper is like "oh, i see you have a foreach going here, i recommend you replace it with a completely illegibile ten-line linq query"
|
# ? Jan 24, 2014 04:44 |
|
coffeetable posted:LINQ expressions are supposed to be free of side effects, because procedurally-minded devs playing with lazily-evaluated side-effects is a recipe for disaster. of course there's nothing enforcing that and people do xs.Select(x => spray_state_everywhere(x)) all the time, but the C# team feel that a ForEach() would just be encouraging people or just write like a four-line extension method. but it gets bad when your statement extends past just a single line
|
# ? Jan 24, 2014 04:46 |
|
linq is so great, probably the #1 c# feature i miss in java
|
# ? Jan 24, 2014 04:48 |
|
Notorious b.s.d. posted:normally i disregard it when people talk shop about js frameworks because i hate js and i hate browsers. but when someone who hates js and likes actual good languages endorses knockout, i think i had better take a look MVC 4/5 have 2 default javascript includes. jquery and knockout. If you've ever used xaml before knockout will make loads of sense. you create your markup and anywhere you want dynamic content you put a data-bind tag w/ the bind information and the source in the view model. THen in ur view model you do stuff like have normal fields and then also dependent fields that are changed when the fields they depend on change. u can either put data into this viewmodel during the generation of the page and/or pump json into it via the ko.mapper plugin after the page is loaded. if you wanted to be really stupid you could probably do like a websockets or some other persistent connection w/ a server to continuously update data on the page by updating the fields of the viewmodel. it works and its not bad. I mean its not as good as xaml but what is? for my current project it was a lifesaver cause of the static markup restriction and w/out knockout it probably would have been a massive pain in the dick. if I didn't have that restriction I would still probably use it, but not as much. Like anything if you don't need to use it then don't try to force it in there.
|
# ? Jan 24, 2014 04:49 |
|
HORATIO HORNBLOWER posted:haskell is so great, probably the #1 feature i miss in java
|
# ? Jan 24, 2014 04:53 |
|
HORATIO HORNBLOWER posted:linq is so great, probably the #1 c# feature i miss in java tie to learn scala
|
# ? Jan 24, 2014 05:25 |
|
Shaggar posted:i don't think im actually using ForEach im just using stuff like GroupBy and Select and ToDictionary for transforming data. where is shaggar and what did you do to him
|
# ? Jan 24, 2014 05:40 |
|
im here. writing some interfaces for various components of my Pandora client that contain async requests and event delegates for handling the results so I can separate the various event generators and consumers so they only need to know about their own stuff.
|
# ? Jan 24, 2014 05:49 |
|
Notorious b.s.d. posted:tie to learn scala i looked at it but what a pain. not nearly as ridiculous as clojure but still it's just not worth it
|
# ? Jan 24, 2014 06:45 |
|
HORATIO HORNBLOWER posted:i looked at it but what a pain. not nearly as ridiculous as clojure but still it's just not worth it it is really not a pain if you don't want to use the panoply of crazy features, no one will ever make you. You can just sit tight and use it as a java with lambdas and mixins and properties. That's what I have been doing
|
# ? Jan 24, 2014 07:07 |
|
julia seems like basically the best thing ever. someone talk me out of learning it
|
# ? Jan 24, 2014 07:38 |
|
dont learn julia
|
# ? Jan 24, 2014 09:00 |
|
some guy on hn is betting on julia!!
|
# ? Jan 24, 2014 09:01 |
|
the talent deficit posted:julia seems like basically the best thing ever. someone talk me out of learning it It treats UTF-8 strings like arrays of bytes. This is bad.
|
# ? Jan 24, 2014 11:41 |
|
coffeetable posted:BALLMER BALLMER BALLMER BALLMER
|
# ? Jan 24, 2014 12:43 |
|
the talent deficit posted:julia seems like basically the best thing ever. someone talk me out of learning it in the future half the people who write lovely unreadable matlab programs will be writing lovely unreadable Julia programs instead
|
# ? Jan 24, 2014 15:24 |
|
the world runs on lovely unreadable code, pushing people from matlab to design-patterned uml-modelled high design poo poo would be a huge loss of programmer efficiency also, if you think such a thing as an ugly piece of code that is less than a kloc exists you are too concerned with irrelevant trivialities
|
# ? Jan 24, 2014 15:34 |
|
Cybernetic Vermin posted:the world runs on lovely unreadable code, pushing people from matlab to design-patterned uml-modelled high design poo poo would be a huge loss of programmer efficiency challenge accepted code:
code:
code:
|
# ? Jan 24, 2014 15:39 |
|
thing is, it really does not matter, i really don't care. if the code breaks then it will usually become fairly clear from the break what the code *should* do, and if it isn't doing it and appears too incomprehensible then such tiny fractions of code are better to just rewrite to do the right thing as long as some reasonable module-level abstractions are somewhat maintained any local ugliness is not worth caring about i also wrote kx k3 for a living for a number of years, production code could look roughly like this: http://kx.com/a/k/examples/xml.k
|
# ? Jan 24, 2014 16:00 |
|
fritz posted:in the future half the people who write lovely unreadable matlab programs will be writing lovely unreadable Julia programs instead this would be a pretty significant improvement tbh
|
# ? Jan 24, 2014 16:24 |
|
pointsofdata posted:this would be a pretty significant improvement tbh yeah i only wish julia had a better type system strong static typing owns when exploratory programming so much time saved
|
# ? Jan 24, 2014 16:36 |
|
Cybernetic Vermin posted:i also wrote kx k3 for a living for a number of years, production code could look roughly like this: http://kx.com/a/k/examples/xml.k holy poo poo mumps has a cousin
|
# ? Jan 24, 2014 18:50 |
|
Shinku ABOOKEN posted:holy poo poo measles? rubella?
|
# ? Jan 24, 2014 19:00 |
|
Cybernetic Vermin posted:thing is, it really does not matter, i really don't care. if the code breaks then it will usually become fairly clear from the break what the code *should* do, and if it isn't doing it and appears too incomprehensible then such tiny fractions of code are better to just rewrite to do the right thing to rewrite requires knowing what the original code even does
|
# ? Jan 24, 2014 19:04 |
|
knowledge that is better inferred from the module-level abstraction and the components overall role in the system than from trying to infer anything from the code, because in the local view of the code you have no means of differentiating between the intended functionality and the functionality that induces the problem anyway 1 kloc may be an overstatement, but huge and messy functions are really not problematic if you can somewhat describe what goes in and what is supposed to come back out
|
# ? Jan 24, 2014 19:33 |
|
Cybernetic Vermin posted:1 kloc may be an overstatement, but huge and messy functions are really not problematic if you can somewhat describe what goes in and what is supposed to come back out the cool part is how in bad code, your initial impression of what is "supposed" to happen does not match what actually has been happening for a very long time, so when you fix something that appears broken, it probably subtly broke something else that depended on the broken behavior
|
# ? Jan 24, 2014 19:38 |
|
i'm trying to learn ruby and it bugs the crap out of me that 0 evaluates to true.
|
# ? Jan 24, 2014 20:13 |
|
Sagebrush posted:i'm trying to learn ruby and it bugs the crap out of me that 0 evaluates to true. really? that seems wrong to me. is there a reason for it?
|
# ? Jan 24, 2014 20:19 |
prefect posted:really? that seems wrong to me. is there a reason for it? everything in ruby is an object.
|
|
# ? Jan 24, 2014 20:22 |
|
|
# ? May 18, 2024 09:08 |
|
prefect posted:really? that seems wrong to me. is there a reason for it? gucci void main posted:everything in ruby is an object. "why is the sky blue?" "because ants have six legs"
|
# ? Jan 24, 2014 20:36 |