User loginNavigation |
LtU ForumA programming language with extensible syntaxHere is an introductory article about a programming language with extensible syntax, based on a mixture of PEGs and classic Lisp macro metaprogramming. A preliminary version of the language compiler is also available (it needs Microsoft .NET Framework or Mono to run, syntax highlighting editor works on Windows only). 2009 Lang.NET2009 Lang.NET videos are available here Some of the speakers include: How to ensure safety when millions of users inject scripts into a running system?Although my motivation is financial systems, I use the example of computer games to make the discussion appeal to a wider audience. Assume there is an on-line video game which has tens of millions of users. The game is some sort of strategy game with armies, battles, shootouts, etc. Although most players control everything manually, the game provides a way for players to script their actions. For example, a script could tell three soldiers to spread out in a triangle whenever they see a certain monster. Another script could have the workers automatically produce new soldiers as old one die out. In this scenario, it makes sense to provide a proprietary, domain specific, scripting language that lets players cause all kinds of mayhem with virtual guns, but doesn't allow formatting the local disk drive. As the game becomes more popular, some players demand more features in the scripting language. They wish to do monte-carlo simulation to figure out the possible outcomes of an attack. They wish to buy third-party scripts and integrate them into their own scripts, etc. The game writers decide that they should create a general purpose language. They write their game engine in this general purpose language and accept scripts in the same general purpose language. This allows a community to grow around the language, with nice tools, libraries, compiler/interpreter optimizations, etc. However, this language must have the ability to control what these 'injected' scripts can do. Obviously these scripts can't modify the game engine, itself, they can't access the local disk, they can't create data-structures that eat up all the memory, they can't hog all the cpu, etc. What kind of language is this? What real-world examples are there that do this or what papers describe such systems? To partially answer this: the most obvious example is Java and its applet infrastructure. Applet writers embed their programs in web-pages, and don't generally have the ability to access random parts of the local disk, nor do they have the ability to open any tcp/ip ports. Applets, however, don't describe how they can be embedded into a general purpose server--their interaction is strictly defined for a browser and nothing else (as far as I know). Lisp/Scheme system provide the ability to change running code. The clojure folks have an amazing (to me) example where a programmer telnets into his server and changes a servlet as it is serving pages to users. Other languages provide the ability to interact with the server: Erlang and Java (via osgi) come to mind. However, these interactions don't necessarily happen in a safe enough manner. They are certainly not designed to host little programs from millions of users whose competence and ethics may vary. Haskell provides a way to keep pure code separate from code with side-effects. Perhaps the server only accepts pure Haskell code, thereby ensuring users don't do any I/O. However, Haskell also desn't have a good way of 'dynamically loading' code (hs-plugin is not very pleasant to use). I may wish to stop users from doing disk I/O, but they shouldn't have to jump through hoops to generate random numbers or mutate local state. It seems to me that the right language to allow such a system would have the ability to control effects: but do so at a very granular level: permission for non-deterministic code, mutable state, I/O, etc. need to be controlled separately. How would one ensure that CPU time or memory is used fairly? How could the server writers make sure use scripts actually terminate (no infinite loops or recursions, beyond the global event loops which exists as long as the game continues)? Can type/effect systems solve this? Is this better handled by virtual machines or run-time checks? Other examples where such a system can be useful: ChallengesI think that this is a very well written paper about the challenges facing the computing and software worlds at the beginning of the 21st century. There are two on line versions: a word version and an HTML version. By Hank Thediek at 2009-04-16 13:27 | LtU Forum | login or register to post comments | other blogs | 4216 reads
FringeDC Formal Meeting- April 18th 12PM Noon- Advanced Common Lisp FeaturesFringeDC is a group in Washington DC interested in functional and fringe programming languages (Lisp, Haskell, Erlang, Clojure, Prolog, etc.) www.lisperati.com/fringedc.html In this presentation, Philip Fominykh will be presenting readtables, MOP, persistency of image, FFI, readtime/runtime separation and similar Common Lisp subjects. The presentation will be geared towards non Lispers, so don't be intimidated! The meeting is generously hosted by Clark & Parsia (tinyurl.com/6wmmbj) located at 926 N St NW rear Studio #1 Washington DC and is near the Convention Center Metro Stop. Map: tinyurl.com/7mbc4o Anyone is welcome to join our meetings! By drcode at 2009-04-15 10:57 | LtU Forum | login or register to post comments | other blogs | 4268 reads
multidimensional abstraction?An old saw: IIUC, a problem faced by programming languages is that there are multiple dimensions which ideally could all be serviced, but in the end in 2D ASCII aren't. The "expression problem" is a classic example thereof. I am wondering what the current state of the art is / new promising directions people have seen? For me, a big part of the problem is that "it depends". When I'm writing code it doesn't bug me to have it split up, but when I'm debugging code I'd rather see things "linearized" rather than have to chase through inheritance relationships to figure out the total gestalt. What underlying representation could we have to allow us to view the code in different ways? Subtext (RIP?), CoreTalk (ok, that might be impenetrable), what else? Are we just doomed as long as we're still using ASCII? If so, what is the least offensive approach? Generic programming a la STL? Multimethods? How can we ground the investigation: what metrics tell us which approach is best / does the least harm? New EcmaScript/Javascript specificationA new candidate specification for EcmaScript (formerly "3.1," now "Fifth edition") has been completed. or http://www.ecma-international.org/publications/files/drafts/tc39-2009-025.pdf for the draft spec itself. Why are objects so unintuitive?*quick note: I don't have much formal training in PL's, so if I'm wrong, please correct me. For reference, I know python, C++, C, JAVA, OCAML, LISP, prolog (in that order of familiarity). The quick one liner: The slow multi-liner: Most programming languages have a concept of objects, and allow programmers to define them and describe relationships between objects. The idea of objects helped programming with type-checking, encapsulation, code reduction, etc. In fact, an argument can be made that the job of the programmer is to figure out a representation (real-world object -> code -> binary data) of a problem and a process to solve the said problem. Yet even with the amount of programs being written and problems about objects being solved, rather than converging on a complete representation of real-world objects, objects in programs seem to diverge, where an object from one project is different from an object from another project and is typically different from how a normal person thinks about the real world object. When the representation in code is the same as a person's understanding about a real world object ("common sense" or common understanding), the person can process and reason and be productive with the code with ease (like.. integer object types). On the other hand, if the representation is not the same (unintuitive), then the person has to go through the documentation/look over each line to match up the person's internal representation with the representation in code, making programming difficult (any large scale programming project). Working Definition: Objects in OOPL: Objects in logic programming: Some logic programming languages are object oriented, and with clear definition of objects and relations, come the closest to the way we think about objects. However, logic programming is (typically) done on horn clauses, and uses backtracking to solve the query (run the program). Therefore, you can't put all human knowledge into a prolog program, and still expect it to solve your query in a reasonable amount of time. Conclusion So here's the discussion: How do you improve object and relation definitions in a way that is "natural" and useful to programmers? Is there a provable reason why objects in programming languages are so unintuitive? will they ever be? Twitter and ScalaThought this might be of interest to the Scala (and Twitter and Ruby on Rails) folks here. The Twitter dev team has switched to Scala because RoR couldn't handle the server side traffic. To me this is really interesting since most shops are usually hesitant to switch to "academic" languages, but here we are. And I'm pretty sure its not an April Fool's prank either! zip in the point free styleHi, I have been recently trying to read the book algebra of programming which discusses a point free style of functional programming which can be quite appealing (via fold functions)- but there are some details which I dont quite understand yet (so far I have only gotten through the first few chapters since I had to go find a book on category theory to understand some of the terminology). The question I have is how do you do things like zip in the point free style especially if you have different fold functions for the two things you wish to zip? Thanks in advance, Carter. |
Browse archives
Active forum topics |
Recent comments
9 weeks 7 hours ago
9 weeks 14 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