|
MononcQc posted:More languages with optional typing systems: link
|
# ? Mar 5, 2013 01:14 |
|
|
# ? May 9, 2024 23:07 |
|
MononcQc posted:Optional typing systems a good post
|
# ? Mar 5, 2013 01:18 |
|
Malcolm XML posted:Technically dynamic languages have exactly one type ( haskell's data.dynamic allows you to do some neat things) Well, no, this is not true, and the only people who say this have heads so broken they can't imagine otherwise. The difference is this: Types are carried by the value at runtime, and checked at runtime, rather than variables having types and this is checked at compile time. Some systems use structural type equivalence, some use nominative type equivalence. Some allow both. Optional type checking is one of those things people don't seem to get. It's as if the TDD movement said 'you shouldn't be able to compile your code if your test doesn't pass', and work out the error from the conflicts, rather than being able to trace through the behaviour that did that.
|
# ? Mar 5, 2013 01:22 |
|
ps wadler wrote a paper on threesomes with an without blame which talks about writing a type system for dynamic languages that allows runtime casts but preserves enough information to know where the issue came from and haskell lets you defer errors to runtime too. seriously.
|
# ? Mar 5, 2013 01:23 |
|
I'm not sure if I'd call clojure optionally typed since no actual type checking goes on. there's nothing to stop you from doing (def ^int an-int "totally not an int") for example. e: but seriously optional typing is really the most obvious way to get the best of both worlds and i wish more languages supported it. also actionscript is optionally typed, hilariously enough. Police Academy III fucked around with this message at 01:29 on Mar 5, 2013 |
# ? Mar 5, 2013 01:25 |
|
Shaggar posted:we're using dts on 2000 and barely suits our needs now. ssis has the potential to fix a lot of problems we have w/ the limitations of dts and I have no problem spending time writing connectors or whatever to provide more functionality. right now we have this piece of poo poo esb (mule) that I want to throw away and ssis will let me throw away like 90% of what we use mule for. have you looked at fuse esb? if you have to integrate with ANY linux or unix EVER then ssis is going to suck for you (beyond it's normal stupid limitations)
|
# ? Mar 5, 2013 01:26 |
|
Police Academy III posted:I'm not sure if I'd call clojure optionally typed since no actual type checking goes on. there's nothing to stop you from doing (def ^int an-int "totally not an int") for example. actionscript is a lot like javascript, only moreso. it's a better ecmascript and it's trapped in a worse environment.
|
# ? Mar 5, 2013 01:30 |
|
trex eaterofcadrs posted:have you looked at fuse esb? no I haven't looked at fuse. i think the plan is to replace mule w/ BizTalk. the thing is im the only guy who understands linuxes and I don't have time to build all the monitoring/admin tools that BizTalk would provide into mule. also idk about integrating ssis w/ a Linux, but im sure it can integrate fine w/ services on a Linux. also we'll probably get rid of most of the linuxes we have here eventually. we've already been deploying everything (including tomcat) to windows when new servers are needed so Linux will be phased out as old services are upgraded.
|
# ? Mar 5, 2013 01:31 |
|
like maybe fuse is good? idk? but i don't have the time or the patience to be the guy dealing with both the Linux administration and the Linux development.
|
# ? Mar 5, 2013 01:32 |
|
Malcolm XML posted:Technically dynamic languages have exactly one type ( haskell's data.dynamic allows you to do some neat things) Scala has dynamic too :3 Scalaz is very awesome too.
|
# ? Mar 5, 2013 01:32 |
|
fuse is super #1 because of sshfs
|
# ? Mar 5, 2013 01:33 |
|
tef posted:ps wadler wrote a paper on threesomes with an without blame we aaaaaaaaall agreed to be one kind at first but someone changed at runtime
|
# ? Mar 5, 2013 01:33 |
|
Shaggar posted:like maybe fuse is good? idk? but i don't have the time or the patience to be the guy dealing with both the Linux administration and the Linux development. you can deploy it on windows, the main reason its integration is so good is because of camel. obviously that only really matters in hetero environments. if youre going all win then it's prob not worth it i really like fuse because of mvn + camel + osgi. it makes my life so much better to not have to worry about version of this or jar of that and just let the thing handle itself. but i hear ya on the linux admin poo poo, i just deploy my poo poo to the ~*cloud*~ and let jmx tell me if something is wrong
|
# ? Mar 5, 2013 01:47 |
|
tef posted:Well, no, this is not true, and the only people who say this have heads so broken they can't imagine otherwise. bob harper disagrees with you
|
# ? Mar 5, 2013 01:54 |
|
But what about when you compile c++ with -fno-rtti?! Is my naivete revealing itself when I say that I can't think of an example where a runtime error would be preferable to a compiler error?
|
# ? Mar 5, 2013 01:56 |
|
this thread is loving awful
|
# ? Mar 5, 2013 01:57 |
|
Bream posted:Is my naivete revealing itself when I say that I can't think of an example where a runtime error would be preferable to a compiler error? actually it's your common sense
|
# ? Mar 5, 2013 02:01 |
|
i believe the post that I wrote already explained this "Well, no, this is not true, and the only people who say this have heads so broken they can't imagine otherwise." i'd put you on two for two on not reading my post or his strawman
|
# ? Mar 5, 2013 02:13 |
|
whether or not a compiler balks at a possible runtime error at compile time is a feature of the compiler, not the language. languages with explicit type annotations make this easier for dumb compilers, and some smarter languages let you annotate just enough for it to infer the rest. smarter languages still let you type check your program, and run it too. without predicating one on the other. haskell for instance lets you defer errors to runtime.
|
# ? Mar 5, 2013 02:16 |
|
tef posted:whether or not a compiler balks at a possible runtime error at compile time is a feature of the compiler, not the language. Sure, I can dig it. Have you ever used that, or can you think of a circumstance in which you'd want to do that? (serious q)
|
# ? Mar 5, 2013 02:17 |
|
"Dynamic typing is but a special case of static typing, " Or, static typing is a special case of dynamic typing. Makes as much sense. It's like saying 0 is a special case of 1. Sure enough you can simulate a dynamic language by having one ginormous union type in a explicitly typed language, and weirdly enough you can do the opposite too, simulating a static language in a dynamic one is also possible. WOAH MIND BLOWN If you learned logic you'd understand what a contrapositive is.
|
# ? Mar 5, 2013 02:18 |
|
Bream posted:Sure, I can dig it. Have you ever used that, or can you think of a circumstance in which you'd want to do that? (serious q) if I asked, 'can you ever think why it might be easy to debug failure by running code that doesn't pass tests', would you have an answer for that? explicit type checks, tests and other forms of verification are useful, but as anyone who has tried to understand STL errors, sometimes it's easier to understand how your code got that way than how the error is reported.
|
# ? Mar 5, 2013 02:21 |
|
i'm waiting for the classic scoff where someone indicates how not understanding hm type inference is a valid reason to make programs hard to debug, and then ignore that haskell has allowed you to defer errors to runtime for months now, to aid debugging and prototyping
|
# ? Mar 5, 2013 02:24 |
|
weed is a special case of balls
|
# ? Mar 5, 2013 02:25 |
|
tef posted:if I asked, 'can you ever think why it might be easy to debug failure by running code that doesn't pass tests', would you have an answer for that? Okay, yeah, I can see how being able to trace something or look at real, live state at the time an error occurred would be easier than running something in your head.
|
# ? Mar 5, 2013 02:28 |
|
Bream posted:Okay, yeah, I can see how being able to trace something or look at real, live state at the time an error occurred would be easier than running something in your head. My head is small and my programs run across different machines in subtle ways. Logging saves my butt almost as much as defensive coding, failing fast, isolation and process supervision does. I haven't found that being explicit about types has made a significant difference in program quality, because so much of the errors I encounter are transient hardware issues. Handling all errors by supervision, isolation and all that stuff means I implicitly handle my lovely code too. It tends to make things work most of the time, and prevent one bug collapsing the system. there is also an argument that dynamic types make it easier to update running code in production, without having to turn things on and off again as a whole. I'd really like to be able to write code and then introduce annotations that could be optionally checked by runtime, but not have the program be constrained by the checking, or my types to be limited in the same way. That I can't add a type for a string of a certain format, and handle validation cleanly, in almost any language static or dynamic, means I'm always forced to check things at runtime. if I could write types as functions, that would be neat. if the compiler could work out when those runtime checks are always true, or always false, it could either elminate the code, or tell me about the problem code. this is actually what a language called sage does.
|
# ? Mar 5, 2013 02:35 |
|
tef posted:That I can't add a type for a string of a certain format, and handle validation cleanly, in almost any language static or dynamic, means I'm always forced to check things at runtime. just use java Java code:
|
# ? Mar 5, 2013 03:39 |
|
MononcQc fucked around with this message at 03:57 on Mar 5, 2013 |
# ? Mar 5, 2013 03:53 |
|
tef posted:i believe the post that I wrote already explained this normally i respect your opinion because you seem well educated, but i'm gonna have to defer to professor harper on this one, sorry. whatever lame excuses you might use against me ("hurrrr learn logic") surely do not apply to him. i doubt you understood his post if you think it's just a strawman
|
# ? Mar 5, 2013 04:06 |
|
Win8 Hetro Experie posted:just use java blargh. dynamic typing is gross
|
# ? Mar 5, 2013 04:06 |
|
tef posted:I'd really like to be able to write code and then introduce annotations that could be optionally checked by runtime, but not have the program be constrained by the checking, or my types to be limited in the same way. so you want an assertion? tef posted:That I can't add a type for a string of a certain format, and handle validation cleanly, in almost any language static or dynamic, means I'm always forced to check things at runtime. are you serious? using ML as an example: create a module containing a type validated_string which is abstract to the outside world. in this module's interface, provide a function to create a validated_string from a plain string, which checks for the formatting you wanted. your interface should export no other way to create a validated_string. now make all the necessary functions require a validated_string as input, and the compiler will ensure it is always the case
|
# ? Mar 5, 2013 04:16 |
|
I've always wondered how that view fits with an idea like this one: I take my Haskell code, and each type class I have or whatever instead becomes some kind of hidden tuple that I get to evaluate at run time instead. So that something like 'Tree a' is in fact '(Tree a)', where 'Tree' is some kind of label only the runtime system (say a VM) could see and evaluate as in a strong dynamic type system. My Haskell suddenly becomes dynamic, but only for that specific implementation. I only decided to defer the evaluation of the types to the run time rather than doing it at compile time (or I could even do both, even if it would be useless). Does Haskell suddenly become unityped? Has the language definition drastically changed? Is the level of typedness decided by the compiler's type checker or by the language specification?
|
# ? Mar 5, 2013 04:18 |
|
tef posted:i'm waiting for the classic scoff where someone indicates how not understanding hm type inference is a valid reason to make programs hard to debug, and then ignore that haskell has allowed you to defer errors to runtime for months now, to aid debugging and prototyping here you go then: if a person does not understand hindley-milner type inference, that is a valid reason to tell him to choose another career path. i'm serious, if you cannot grok a simple unification algorithm that basically boils down to "the caller must be consistent with the callee", you belong as far away from source code as society can possibly place you
|
# ? Mar 5, 2013 04:22 |
|
MononcQc posted:Does Haskell suddenly become unityped? Has the language definition drastically changed? Is the level of typedness decided by the compiler's type checker or by the language specification? hmm that's an interesting question! i'm not sure, but because harper likes standard ML, i suspect he would defer to the language specification, which might "prevent" you from deferring type checks until runtime
|
# ? Mar 5, 2013 04:26 |
|
static typing with template support owns bones. haskell and c++ are the two greatest languages in the world.
|
# ? Mar 5, 2013 04:29 |
|
JewKiller 3000 posted:so you want an assertion? It can be a bit like an assertion, but the idea could be more flexible. You could see it as a protocol checker that sits between two actors or endpoints and analyzes the transactions, logs errors and sends notification without crashing if you wanted. The same way someone could do XML schema validation and still decide to process broken but still manageable requests (or queue them for human treatment or whatever), you could special-case handling of broken type contracts that would be stricter than what the actual dynamic program is ready to accept and deal with. The idea would be that the same way you can use optional type checking to tell you "this poo poo will break" but compile anyway, you could turn up or down how strict your protocol checking is at run-time by telling the VM or interpreter or whatever whether it should start enforcing the annotations or not, and if so, how strict it should be at it.
|
# ? Mar 5, 2013 04:30 |
|
JewKiller 3000 posted:hmm that's an interesting question! i'm not sure, but because harper likes standard ML, i suspect he would defer to the language specification, which might "prevent" you from deferring type checks until runtime But Haskell allows to defer type errors to the run-time on GHC! Is Haskell sometimes unityped now? That's what tef was getting at, I think.
|
# ? Mar 5, 2013 04:31 |
|
tef posted:ps wadler wrote a paper on threesomes with an without blame which talks about writing a type system for dynamic languages that allows runtime casts but preserves enough information to know where the issue came from and haskell lets you defer errors to runtime too. seriously. -fdefer-type-errors, and -XTypeHoles are two of the greatest assets to haskell programming imo
|
# ? Mar 5, 2013 04:32 |
|
MononcQc posted:But Haskell allows to defer type errors to the run-time on GHC! Is Haskell sometimes unityped now? basically i think harper is arguing that, since a language like haskell can be made "dynamically typed" when necessary as you describe, but in addition it also supports other static types, there is no reason to use so-called dynamic languages where the unitype is the only one available
|
# ? Mar 5, 2013 04:35 |
|
|
# ? May 9, 2024 23:07 |
|
it turns out that's a dopey thing to say
|
# ? Mar 5, 2013 04:35 |