User loginNavigation |
LtU ForumBrendan Eich, CEO of mozillaCorrect me if I'm wrong, but I think this is the first case of a language designer making it to the top slot of a company! "null" is to tagged unions as ???? is to recordsMany programmers are not aware of tagged unions and I love introducing them. I talk about how records and tagged unions are two complementary and fundamental constructs, and that But this got me thinking, if Any ideas? Or am I thinking about this the wrong way entirely? Multimethods over structural typesHello, I am interested to know if there are languages out there, or research projects, or people's wild private imaginings, that provide polymorphic multimethods over structural types. I mean the non-parametric type of polymorphism where methods may have > 1 implementation. The dispatch mechanism would choose the most specific of those available for a given invocation. I have found one mention of something that seems in this area, but I don't understand the paper enough to know if it's what I hope for: Combining Structural Subtyping and External Dispatch I'm not _even_ a language design noob, and have only recently found there is established terminology ("structural types") for what I've been edging towards for about 10 years. But… I envisage that the dispatch mechanism would be able to examine implementations of a method for the signature they require of their arguments. Given a method invocation is would be able to find the most specific implementation given the types, or fail if there is no match or the match is ambiguous. I also think that a kind of transitive closure is necessary here. I'll use an example to elucidate (the example is "single dispatch", btw):
def area(shape) # implementation 2 def width(shape) def height(shape) I can now evaluate: area( {radius: 1} ) area( {square_size: 2} ) Implementations's parameters are not decorated with explicit type declarations because the type an implementation needs for each of its arguments _are_ the methods it calls on those arguments. So, if this kind of thing is going on all over the place and well known, I'd love to know. Or if it's been tried and found a terrible idea, that'd be good to know too :-) I find the possibility enormously exciting because I think it'd "fix" an awful lot of what I find rather hobbling about the languages I generally use. Especially if it could be embedded in some kind of live-coding environment. Thanks, bodyf*ck: an esoteric programming environment using camera inputA product of critical programming language design. Abstract:
Expletives stared out because I'm a coward. By Sean McDirmid at 2014-03-13 03:51 | LtU Forum | login or register to post comments | other blogs | 4599 reads
Julia has no dependent typeshttps://github.com/JuliaLang/julia/issues/6113 sorry if this has already been posted; i don't read here much and ltu was mentioned in the link above (but i can't find anything). i want to ask some questions about my limited, practical, non-theoretical understanding of dependent types: it seems to me that in julia i can define a datatype (something like a struct in c), that has an associated parametric type that contains information about the data. so, for example, i could put the length of an array in there. and then, as long as any code that constructs or modifies an instance of that datatype follows the contract implicit in the associated parametric type, the code will work correctly and i can dispatch on array length. now, it seems to me that this differs from how i expected dependent types to work, in that there is no inspection of the actual data value on dispatch. when i dispatch on the array length i am using information in the parametric type associated with my datatype that i trust is correct. but there is, at the moment of dispatch on that type, no inspection. length(array) is not called. so the correctness of my code depends on the correctness of functions that construct and modify the datatype, rather than on functions that inspect it. so my questions are: 1 - do other dependent type systems inspect the data? 2 - is this just an implementation detail, or is it connected with what was argued about in the link? 3 - please can someone explain the link like i am five? if the above is not connected with the argument, then i don't get it... in particular, julia often (usually?) compiles code specific to particular types. it doesn't do type unification (HM), afaik, but it does propagate types from annotations, and all concrete types are final (leaf), so the compiled code is "static" in some sense. thanks, [edit: i don't know in detail how julia works, but my impression is that although it's called a "jit" it's basically a static compiler that is triggered only when dispatch on a new combination of function and types is encountered. wherever possible it extrapolates type information to compile static code with fixed types. this is why it is fast.] Limitations of FRP?I'm doing some research on programming paradigms that deal with time, like functional reactive programming, and I was wondering if anyone has explored how far one can go with FRP? From my own personal experience when doing Superglue (an OO reactive PL based on FRP-like signals), I had to abandon FRP when working on incremental compilation and language-aware editing: although FRP should be suitable for this problem (lots of consistency to maintain between code, AST, type system, and UI), it turned out that the problem required adding things to collections in distributed locations (e.g. in parse tree computations), whereas FRP seems to require everything for some state to specified centrally. The best source I can find for pushing FRP for more complex programming domains is Antony Courtney's thesis. This still seems to be where things are at. The last time we discussed this topic was in 2007. Are there any new developments in FRP expressiveness? The Evolution of CS PapersA blog post by Crista Lopes discussing the evolution of CS papers away from positions into the realm of science; excerpt:
Haxe 3.1 is hereHaxe 3.1 is here. It is a language that is sorta rooted in the bog-standard main-stream (it came out of Action/Ecma scripts), but has gradually (especially in the move from 2.0 to 3.0+) been adding some of its own ideas. I've used 2.x for making cross-platform games. I sorta love/hate it, but I'd certainly be a lot more sad if it stopped existing, having known it (not in the biblical sense or anything). There's probably too many random things to go into any detail here, but I'll try to summarize it as: A cross-platform (compiles down to other languages) statically and dynamically typed (including structural typing) language and libraries, with some nifty typing ideas/constructs and syntax of its own. Oh, and: macros. (But it has seemingly weird lapses, like I dunno that it will ever really support The Curiously Recurring Template Pattern, tho which I find personally sad). Query Languages for doing NLPI was wondering what kind of query languages are out there for doing NLP. This NLP lecturer mentions using Part-of-speech tagging to create Regular expressions: https://www.youtube.com/watch?v=LivXkL2DO_w&list=PLuBJa2RktQX-N0flCReMywxy1E-tsF0ZC#t=547 In addition to being able to query bodies of text by part of speech, I would like some special functions for searching for synonyms and stemming. For example, "synonyms('fun') Noun" would match "enjoyable game" and "amusing clown", and "sharesStem('swimming')" would match "swimmer", "swims" and "swim". I would be interested in hearing more ideas for NLP query languages. By nabreit at 2014-03-04 00:08 | LtU Forum | login or register to post comments | other blogs | 3707 reads
Syntax for reification of typesHi all, I've got a little language with a syntax resembling C#. It is statically typed, and performs type inference. Functions are polymorphic, and don't require the type of the arguments to be explicit. I am trying to avoid dynamic typing as much as possible. Functions are reified during function invocation based on the inferred type of the arguments. In order to pass a function as an argument, or store it in a variable, I need a convenient way of performing the reificiation. Here is the syntax that I am considering:
As in C# the "=>" operator represent the lambda operator but here the symbol "->" now represents the function reification operator. Does this make sense? Any other suggestions or examples of how it is done in other languages? Thanks in advance! |
Browse archives
Active forum topics |
Recent comments
9 weeks 13 hours ago
9 weeks 20 hours ago
9 weeks 1 day ago
9 weeks 1 day ago
9 weeks 5 days ago
9 weeks 5 days ago
9 weeks 6 days ago
9 weeks 6 days ago
9 weeks 6 days ago
9 weeks 6 days ago