User loginNavigation |
LtU ForumStructured Generative Models of Natural Source CodeInteresting/weird paper on Arxiv, abstract:
This field of "natural source code" is completely new to me, and seems to arise out of this paper, abstract:
Booleans vs stringsI'm working on a simple, dynamically-typed language for business users. We're trying to have as few datatypes as possible to reduce the number of things they have to learn (currently just strings, numbers and tables). I'm considering just using "true" and "false" strings instead of boolean values. I can't see any arguments against it but I can't help feeling that I'm going to regret it. Is this sensible? The only language I'm aware off that does something similar is TCL, which also allows yes/no/on/off. EDIT: I suppose erlangs true/false atoms are similar. That gives me some encouragement. Designing an alternative to s-expressions for language extensibilityWhile designing my own programming language, I experimented a lot with syntax, but I quickly determined that there are three things I really wanted:
This was an incremental process that I barely documented as I went through it, but in the end I think I came up with something interesting, a kind of syntax that I call o-expressions. I have thought about it a good deal post hoc so that I could explain and justify my findings and I am at a point where I would appreciate some external feedback and criticism. I wrote two blog posts about it: First, this post describes Liso, a translation of my syntax to s-expressions. It contains many examples, so you can get an intuitive grasp of it. It demonstrates a concrete use as syntactic sugar for Lisp-like languages and I implemented it as a Racket #lang, so you can try it out if you want (source). My second post is more theoretical. In it I build o-expressions from scratch using principles that I believe are essential to language extensibility. I plan to keep working on the syntax and port it to other languages, so feedback would be very welcome :) Minimal implementation of state machinesDear all, I fear this may be a really strange question, but LtU seems the best place to ask it anyway. I am working on a programming language, Casanova, built for interactive applications and games in particular. The language is built in order to enable applications to implicitly update their state with continuously run "rules" which can also be suspended easily. For example, a lightswitch would be implemented quite easily as:
world LightSwitch = {
Sprite : Sprite
Pressed : bool
rule Pressed =
when(IsKeyDown(Keys.Space))
yield true
yield false
when(IsKeyUp(Keys.Space))
rule S.Color =
yield Color.White
when Pressed
yield Color.Black
when Pressed
}
I would like to try and formalize why this approach is better than existing patterns commonly found in the literature for encoding state machines. I do not wish to do a survey of existing techniques and count lines of code or number of statements. This is clearly a viable approach, but for once I would like to go formal instead of empirical. My goal is to show a way to encode the program above in a simple imperative language. I would then like to prove that this encoding is minimal with respect to the number of statements used. Finally, I would like to show that the encoding produces code which contains far more statements than the Casanova implementation. The issues I have are: I have no clue how to go with a proof of minimality for some encoding, and I wonder if the overall approach sounds convincing to you guys. And the Academy Award goes to... a literate programMatt Pharr, Greg Humphreys, and Pat Hanrahan have recently been given an Academy Award for Technical Achievement, for the book Physically Based Rendering. This is the first time the award has been given to a book and (more relevant to LtU) the first time a literate program has won an Academy Award. By Tess Foley at 2014-01-23 22:52 | LtU Forum | login or register to post comments | other blogs | 23453 reads
Examples for benefitfs of dynamic programming languagesHi, Could anyone of you imagine concrete situation, where the static type system is more an obstacle than a helpful tool? POPL 2014 proceedings available freely for allThe proceedings can be downloaded from the POPL webpage. I find this extremely exciting (not only because I didn't get funds to attend POPL this year). To my knowledge, this is the first time that this is done in POPL/ICFP/PLDI; electronic proceedings were previously only delivered to attendees, with an explicit request not to share them. I am not sure what is the reasoning that make which people decide to do it this year, or not to do it before. I hope that the proceedings will remain available after the conference (next week), and that this idea will be adopted for the years to come. ACPUL - Another CPU Language - a{};Hi there, I create new platform & language for mobile development. This can run on mobile like Codea or AIDE. Here is IDE screenshots Github & source code (compiler & language) Very simple minimal math language with ideas like STEPS I'm looking for somebody who can help with beta-testing & demo making, language update, etc. Pragmatic aspects of dimension types, and the problem of anglesDimension types are extremely useful for preventing errors in programs that manipulate physical quantities. There are several Haskell libraries for them, F# has a built-in version, etc. (I've read about a nice Python package that addresses the same issues dynamically, which may be a good source of inspiration, though my personal interest is in static approaches.) Of course there is the thorny issue of selecting a basis with which to express dimensions. The dimensions of the SI base units are a common choice. The dimensions of the cgs units are another appealing choice in some respects, though you do need to deal with fractional powers (e.g. Since my target users are engineers, I am inclined to choose the dimensions of the SI base units. For simplicity I will set aside the question of additional user-defined basic dimensions, because it is only slightly related to my primary question. There is broad agreement (for decent reasons) that angles are dimensionless, and there is a long history of mostly treating them that way in the mathematics, physics, and engineering literature. Yet pragmatically, serious errors can arise when revolutions are mistaken for radians or angular velocities are confused with frequencies. Factors of 2 pi are liberally sprinkled all over the place, and it is pretty easy to forget or misplace one. This form of confusion and traditional resort to name-based disciplines seems very much like the type of confusion and lack of formality that dimension types are intended to address. I find that I much prefer my toy system where angles are treated as dimensions to the version in which they are not, because it requires me to annotate all the places where numbers turn into angles (and vice versa) with the "units" that I am intending to use. This naturally leads to extremely good documentation of interfaces, serialization formats, and interoperation with external code. There is a related problem where torques and energies share the same SI dimension ( Should angles be modeled as a dimension for software engineering purposes? Should they be modeled in some other way? Should they be left implicit? (To throw another wrench in the works, similar remarks apply to solid angles, although they may arise considerably less often for my target users. It also feels arbitrary to stop after 3 dimensions, and I assume--although I am not familiar with one--that there is some sort of generalization of solid angles to n-dimensional space.) PuzzleScriptI haven't seen this discussed here yet: http://www.puzzlescript.net/ It is an HTML5-based puzzle game engine that uses a simple language for patterns and substitutions to describe game rules. For example (taken from their introduction), the basic block-pushing logic of a Sokoban game can be given as: [ > Player | Crate ] -> [ > Player | > Crate ]
This line says that when the engine sees the pattern to the left of Rules are matched and applied iteratively at each step (i.e., when the player acts), until there are no more matches, and then movement takes place. There are mechanisms for influencing the order in which rules are run, and for forcing subsets of the rules to be iterated. By default, rules apply to both rows and columns, but horizontal- or vertical-only rules can be created. It is an interesting example of a very narrowly-focused DSL, based on a (relatively) uncommon model of computation. It's also very fun to play with! |
Browse archives
Active forum topics |
Recent comments
9 weeks 16 hours ago
9 weeks 23 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