|
abraham linksys posted:is there a comprehensive overview of typescript that I'm missing? like http://www.typescriptlang.org/Handbook doesn't even tell you the syntax for a loving hash map (which is apparently { [key:string]:Type; }) yeah good luck with that. I tend to piece together stuff from their github wiki, their blog posts (for newer features), and whatever I can google or see is done on the roadmap it is a kind of lovely situation not gonna lie
|
# ? Mar 22, 2016 01:09 |
|
|
# ? Jun 12, 2024 09:18 |
|
piratepilates posted:yeah good luck with that. I tend to piece together stuff from their github wiki, their blog posts (for newer features), and whatever I can google or see is done on the roadmap i'm gonna retreat back to regular ol javascript, then for as undeveloped as facebook's non-react projects tend to be the flow documentation is way better than this
|
# ? Mar 22, 2016 01:11 |
|
if you want a typescript syntax cheat sheet you can try googling for "typescript syntax cheat sheet" although the results will probably be for a pre-1.0 version because gently caress you if you want a "comprehensive overview" then you get to read the spec, sorry
|
# ? Mar 22, 2016 01:20 |
|
abraham linksys posted:i'm gonna retreat back to regular ol javascript, then does flow need that much? also the syntax for a Map is: code:
|
# ? Mar 22, 2016 01:22 |
|
I guess I'll stick with good old code:
|
# ? Mar 22, 2016 01:25 |
|
piratepilates posted:also the syntax for a Map is: meant map in the traditional "object literal" sense not es6 maps other big reason i'm thinking of dropping typescript is that i don't understand how to use it with immutable.js and neither does the rest of the internet, as far as i can see
|
# ? Mar 22, 2016 01:30 |
|
abraham linksys posted:meant map in the traditional "object literal" sense not es6 maps how so? they have a typescript definition file in their repo and short instructions on using it. and object literals should have been covered in the tutorial or handbook
|
# ? Mar 22, 2016 01:34 |
|
MALE SHOEGAZE posted:i'm flying with es6 now and dang it's really really nice. honestly it's pretty decent scripting language. i could see using it over ruby or python. having JS's first class functions along with like...usable templating and finally a decent syntax for anonymous functions is pretty usable and fun. there's lots of good poo poo in modern javascript. and we're getting some good web frameworks these days.
|
# ? Mar 22, 2016 01:38 |
|
Mahatma Goonsay posted:I guess I'll stick with good old ask a dumb question in javascript and get a dumb answer. seems to work fine.
|
# ? Mar 22, 2016 01:40 |
|
piratepilates posted:how so? they have a typescript definition file in their repo and short instructions on using it. so when you make a redux app using an immutable reducer you usually want to define your state tree as an immutable Record, something like code:
my thought was "okay, well this is obviously a case where it'd be fantastic to have real typing! I could say that Ball has "x" and "y" fields that are numbers, and that the "balls" List can only contain Ball() instances." and I can find no way of doing this in Typescript, and googling only turns up issues that seem to indicate that this not possible
|
# ? Mar 22, 2016 01:45 |
|
akadajet posted:there's lots of good poo poo in modern javascript. and we're getting some good web frameworks these days. couple thousand more frameworks and it might be usable
|
# ? Mar 22, 2016 01:45 |
|
Bloody posted:couple thousand more frameworks and it might be usable ember and react are all the frameworks u need
|
# ? Mar 22, 2016 01:48 |
|
Mr Dog posted:Yeah if it were up to me then I'd change Java to (A) make byte unsigned and if I get a B then (B) make "final" the default state of affairs that you have to opt out of. i understand that rust got this right and you have to use "mut" to declare mutability, with immutability being the default. if im wrong someone correct me
|
# ? Mar 22, 2016 02:04 |
|
i'm writing a thing using elm for the front end and i need a backend to pair it with. i was considering typescript but i can't find any node http frameworks that work well with it except maybe express. should i just use servant (haskell) or rust's sinatra clone instead?
|
# ? Mar 22, 2016 02:08 |
|
the talent deficit posted:i'm writing a thing using elm for the front end and i need a backend to pair it with. i was considering typescript but i can't find any node http frameworks that work well with it except maybe express. should i just use servant (haskell) or rust's sinatra clone instead? why the hell you gonna use node.js when you can play with rust instead
|
# ? Mar 22, 2016 02:09 |
|
why would you use rust for an http server when you could use any number of more mature options which, actually, includes node.js never heard a good argument for rust web services. backend services, sure, but your actual endpoint logic?
|
# ? Mar 22, 2016 02:13 |
|
because rust is cool as poo poo and when else do you get a chance to use it
|
# ? Mar 22, 2016 02:15 |
|
Cool as poo poo in a literal sense
|
# ? Mar 22, 2016 02:19 |
|
piratepilates posted:because rust is cool as poo poo and when else do you get a chance to use it i'm already implementing viewstamped replication and pacifica in rust for fun, the elm thing is a prototype for a startup i maybe want to do
|
# ? Mar 22, 2016 02:22 |
|
rjmccall posted:this is essentially what i was saying, thx O_O how do you refer to the type later? can you 'save' it in an alias or something? and who the heck wanted an imperative *type system* Gul Banana fucked around with this message at 03:17 on Mar 22, 2016 |
# ? Mar 22, 2016 03:13 |
|
also, typescript is extremely good but what it's good *for* is building Large Applications. when your team develops a bunch of components in typescript then they all get checking when referring to each *other* and the save-you-from-errors thing works. it's not particularly great for using external libraries, although for a few key ones (react, with typed jsx/tsx!) it is useful. large componentised applications or internal libraries tend to want to avoid dependencies anyway. another way of putting it: typescript is mediocre if you want to buy into the 'JavaScript ecosystem', which is an insane thing to do. it's very good if what you want is to write code that runs in a browser.
|
# ? Mar 22, 2016 03:28 |
|
the talent deficit posted:i'm writing a thing using elm for the front end and i need a backend to pair it with. i was considering typescript but i can't find any node http frameworks that work well with it except maybe express. should i just use servant (haskell) or rust's sinatra clone instead? everyone seems to use either haskell or elixir
|
# ? Mar 22, 2016 05:20 |
|
comedy option: https://github.com/NoRedInk/take-home which is all elm all the time
|
# ? Mar 22, 2016 05:22 |
|
i wrote a web thing in rust but then stopped. the interesting thing about it seems to be getting it to compile anything non-trivial but then not creating anything meaningful. It just felt tedious after the initial hump.
|
# ? Mar 22, 2016 07:20 |
|
Gul Banana posted:another way of putting it: typescript is mediocre if you want to buy into the 'JavaScript ecosystem', which is an insane thing to do. lol
|
# ? Mar 22, 2016 18:55 |
|
Gul Banana posted:also, typescript is extremely good but what it's good *for* is building Large Applications. when your team develops a bunch of components in typescript then they all get checking when referring to each *other* and the save-you-from-errors thing works. I know some people working on a ipython-but-DAG notebook using typescript and they're p happy with it.
|
# ? Mar 22, 2016 19:10 |
|
CPColin posted:So type "final" when you declare the variable? 10 PRINT "Why do A when you can just do B?" 20 PRINT "B is bad because [explanation]. A doesn't have that problem." 30 PRINT "So just do C then?" 40 PRINT "C is bad because [explanation]. A doesn't have that problem." 50 PRINT "So just do B then?" 60 GOTO 20
|
# ? Mar 22, 2016 20:00 |
|
Gul Banana posted:O_O sure, of course. and it'll be in the types of any of the operations on the functor result quote:and who the heck wanted an imperative *type system* i have occasional fantasies of pointing out to bob harper that his language's basic translation model is imperative rather than declarative i should probably get over it, tbh
|
# ? Mar 22, 2016 20:05 |
|
rjmccall posted:i have occasional fantasies of pointing out to bob harper that his language's basic translation model is imperative rather than declarative I have an extremely vague memory of a conversion about generative functors, where somebody (and I think Harper was there, but I don't know if it was him) basically argued that the reason sml was generative was because of ref cells. So each structure could contain internal state. Basically, like the value restriction for let generalization, I think they were already aware that imperative mutationy things were driving the design decisions.
|
# ? Mar 22, 2016 20:20 |
|
Soricidus posted:10 PRINT "Why do A when you can just do B?" 10 END
|
# ? Mar 22, 2016 21:25 |
|
crazypenguin posted:I have an extremely vague memory of a conversion about generative functors, where somebody (and I think Harper was there, but I don't know if it was him) basically argued that the reason sml was generative was because of ref cells. So each structure could contain internal state. the value restriction is a soundness requirement, it's unavoidable without major language changes. if functors were applicative, you could just say that of course ref cells bound in the structure are the same across bindings i mean, the implementation still ends up imperative, it's basically lazy caching of functor application, but the language model stays declarative
|
# ? Mar 23, 2016 00:50 |
|
rjmccall posted:the value restriction is a soundness requirement, it's unavoidable without major language changes. changes like removing unrestricted IO and ref cells to make the language pure instead of imperative. but I think maybe you were making a subtler point that hinges on "language model" vs language, so maybe my point here isn't relevant
|
# ? Mar 23, 2016 01:16 |
|
so i guess this is what happens when you're so close to the metal that you don't have printf and the owner of the "left-pad" module throws a fit: https://twitter.com/seldo/status/712414400808755200 https://twitter.com/seldo/status/712414588281552900 https://twitter.com/seldo/status/712416770682781698
|
# ? Mar 23, 2016 02:00 |
|
it's amazing how many levels of hilarity there are to it: 1. people being able to "un-publish" modules at all 2. un-publishing your modules to protest a third party not paying for a lawyer for you 3. the entire js ecosystem depending on a module that's 17 lines of code
|
# ? Mar 23, 2016 02:20 |
|
e nm
|
# ? Mar 23, 2016 02:27 |
|
crazypenguin posted:changes like removing unrestricted IO and ref cells to make the language pure instead of imperative. yeah you could do that, but we don't do that because it sucks
|
# ? Mar 23, 2016 03:21 |
|
crazypenguin posted:changes like removing unrestricted IO and ref cells to make the language pure instead of imperative. i was thinking more like re-introducing explicit type application
|
# ? Mar 23, 2016 03:45 |
|
wtf is a left-pad
|
# ? Mar 23, 2016 06:10 |
|
Suspicious Dish posted:wtf is a left-pad it puts spaces or zeroes at the left of a string
|
# ? Mar 23, 2016 06:13 |
|
|
# ? Jun 12, 2024 09:18 |
|
i wrote that last nightcode:
|
# ? Mar 23, 2016 06:50 |