User loginNavigation |
LtU ForumDepends on what "is" isSounds like B. Clinton's evasive (but syntactically correct) answer to some deposition. But it's just a little lesson in associativity. We want "is" to be synonymous with "=". That sounds reasonable, right? We could do this at the lowest level, at the lexer, and really make things simple. But here comes "not". It's already an operator, and you want it to be so. And in (my) typeless world, "not" operates on integers just as happily as it does on booleans. There are two reasonable implementations for "not" on integers: multiplying by -1 or the function y = 1 - x. The first is sort of intuitive, the second makes not(1) equal to 0 and not(0) equal to 1. Either way, you lose. Choose the first, so "not x" => -1 * x and examine the expression 0 is not 0 You'd want this to be a false statement, but unfortunately, it might parse like this: 0 is (not 0) Yikes! Tell me that this is just an LL(2) thing and if I look ahead one more token I'll be OK. What I mean by that is: is my hack a canonical hack? When I see "is" I just greedily look ahead to see if the next token is "not". Babel-17 v0.2 spec is outHi, I am currently working on a new programming language which I call Babel-17. It is dynamically typed, mostly purely functional, but also object oriented and supports encapsulation via modules. I have written up a preliminary spec of it, which you can read here. There is no implementation of it yet, but I want to get implementations based on Java and on Objective-C out there as soon as possible. Yes, hopefully you can write parts of your iPad programs in Babel-17 soon :-) Best, Steven Obua Edit: The new version of the spec is v0.21, and there is a reference implementation in form of an interpreter written in Scala/Java. There is also a Netbeans plugin for Babel-17 v0.21 available at www.babel-17.com . What data sets would tell you the most about what sort of programming language to design?Let's say all data in the world is open to you, for the express purpose of understanding the habits of programmers, and you have the best crack team of statisticians in the world to help you analyze it. Which subset of this data would you be most interested in, as a programming language designer or programming language theory researcher? Declarative reactive tablesA declarative reactive table is something that I've invented for building continuous compilers/interpreters: its a table whose changes are not only observable, but the statements to access and populate the table are declarative, meaning their execution order is not important. The table is populated by statements that read like "e_table[e_k] = e_v", where e_table, e_k, and e_v are expressions that are both time-dependent (e.g., they contain continuous signals). An access is simply "e_table[e_k]", where e_table and e_k are expressions that are again time-dependent, while the result is also time dependent. A declarative reactive table is then the peer of a continuous signal, its accesses can be used as signals while it is populated via signal expressions. However, these tables aren't necessarily FRP, since I don't see how the population statements could be made composable. Example: symbol tables in a continuous compiler are declarative reactive tables whose definition nodes in the AST act to populate the map while identifier reference nodes access the table. Then: // define Foo scopeA["Foo"] = FooType; // define bar in Foo FooType["bar"] = IntType; // resolve x = Foo.bar scopeB["x"] = scopeA["Foo"]["bar"] Now, when we edit the definition of "Foo" so that it becomes named "Bob", x's type will be automatically recomputed so that it now undefined (unless there is another "Foo" hiding somewhere). Since AST nodes primarily communicate through symbol tables, we get most of what we need for a continuous type checker out of declarative reactive tables. Its even possible to augment an existing compiler to use these tables (which is what I did for Scala). I'm wondering if anyone has seen a pattern like this before in a compiler implementation or perhaps another domain. I'm also wondering if I could generalize this somehow to FRP, maybe not the pure Haskell kind, but a system like FrTime or Flapjax. more consistent macros?are there good alternatives to macros that give similar power, yet somehow manage to integrate with the non-macro language more cleanly than those of lisps? for example, in Clojure you cannot do eval and (infinite) recursionI'm implementing an "eval" function in a scripting language... or at least contemplating it. I can envision the infinite recursion from as simple a thing as the sequence: set a to "a" if by eval I mean do variable lookup for strings, and the eval is a "deep" eval. Is one always obliged to make the eval a 1-level shallow eval? Or is eval() generally not a variable-lookup operator? I could provide a separate one, an explicitly shallow evalWithLookup() or something... TRIZ plus Axiomatic Design<edit>: more relevant than the paper i originally posted below are comparisons of TRIZ vs. Axiomatic Design.</edit>
are rewrite systems really the bee's kneesI get the impression from reading about rewrite systems that in some sense we should all just give up on other approaches and simply do everything as rewrite rules. But of course I've never really used or learned such things, so I assume there are simple and good and probably quickly obvious reasons why s-exprs and c-style syntaxes are still around. I'd appreciate thoughts/experiences/summaries. Operator precedenceGetting an expression grammar right is a core part of any language. Simple two-level (mult binds tighter than add) examples abound in texts and such. But how far should it be taken? I'm looking at a grammar now (the lamented - by me - HyperTalk) that has ten levels. Is that going overboard? In particular, what do you get by separating equalities from inequalities like this: ( ) // bind tightest I'm constructing a grammar in which the equalities and inequalities have the same level of binding, i.e. it's left to associativity to sort out who goes first. Is there a gotcha waiting for me? Historical or sociological studies of programming language evolution?I have been reading Ostler's "Empires of the Word: A Language History of the World" with an eye towards making analogies between the spread and evolution of natural languages with engineered computer ones. While we prefer to discuss languages here based on 'technical' merits within the language (e.g., ability to reason about programs, performance and implementation implications, etc.), I'm curious about more contextual social factors. For example, one way to explain the creation of FrTime's variant of data flow / FRP is that Greg Cooper was a member of the PLT Scheme community (so it is Scheme based and has side effects), previously worked in embedded systems (so it emphasizes glitch-freedom), and is a member of the PL community / an hour or two from Yale (so influenced by Haskell-style FRP). As another, the recent discussion on LtU about the matlab vs S/R vs python for statistics ultimately was more about communities than technical merit, suggesting the human / societal / cultural element of language use is fundamental to the success of a programming language in terms of penetration. I'm wondering if anyone has suggestions on papers or studies in a similar vein. For example, what was the canonical source breaking down 'generations' of language (first gen, second gen, etc.)? I think there was a neat diagram floating around the web showing a basic parent-child relationship between languages over time. Another relevant one (I believe in CTM) is Peter van Roy's language spectrum focusing on relationships between languages based on features. Another obvious relevant source is History of Programming Language style articles about the inception of particular languages. Paper citation chains hint at time and geographic relationships. If there happen to be linguists around, sharing reading lists about the natural language side of things as I break into this could be fun too :) |
Browse archives
Active forum topics |
Recent comments
8 weeks 1 day ago
8 weeks 1 day ago
8 weeks 1 day ago
8 weeks 2 days ago
8 weeks 5 days ago
8 weeks 5 days ago
8 weeks 6 days ago
9 weeks 2 hours ago
9 weeks 3 hours ago
9 weeks 3 hours ago