LtU Forum

HTML extensibility

What do U guys think of a javascript library that would be able to emulate any programming language?

U would write a code inside tag and call a function to parse and interpret the code found in innerHTML property of . Only necessary thing would be one include inside some javascript src tag that calls specific prebuilt interpreter, so there would be no specific installs like new add-ons for browsers.

So, when U build i.e. Python interpreter, U would (automatically, by provided tool) make a new python.js file (from provided grammar and some sugar besides), include it in html and off U go, modifying html DOM from python.

Theoretically, another markup language could be constructed that would replace HTML, if U want that.

I'm interested would this environment be accepted by programmers. The real question is: how much of programmers are satisfied with HTML + javascript and would they want to use some other combination?

Call for Participation: Programming Languages Mentoring Workshop - a POPL workshop.

CALL FOR PARTICIPATION

SIGPLAN Programming Languages Mentoring Workshop, San Diego, USA

Tuesday January 21, 2014

Co-located with POPL 2014

PLMW web page: http://plmw2014.inria.fr/

After the resounding success of the first two Programming Languages
Mentoring Workshops at POPL 2012 and POPL 2013, we proudly announce the
3rd SIGPLAN Programming Languages Mentoring Workshop (PLMW), co-located
with POPL 2014 and organised by Amal Ahmed, Benjamin C. Pierce, and Alan
Schmitt.

The purpose of this mentoring workshop is to encourage graduate
students and senior undergraduate students to pursue careers in
programming language research. This workshop will provide technical
sessions on cutting-edge research in programming languages, and
mentoring sessions on how to prepare for a research career. We will
bring together leaders in programming language research from academia
and industry to give talks on their research areas. The workshop will
engage students in a process of imagining how they might contribute to
our research community.

We especially encourage women and underrepresented minority students
to attend PLMW.

This workshop is part of the activities surrounding POPL, the Symposium
on Principles of Programming Languages, and takes place the day before
the main conference. One goal of the workshop is to make the POPL
conference more accessible to newcomers. We hope that participants will
stay through the entire conference.

A number of sponsors have generously donated scholarship funds for
qualified students to attend PLMW. These scholarships should cover
reasonable expenses (airfare, hotel, and registration fees) for
attendance at both the workshop and the POPL conference.

Students attending this year will get one year free student membership
of SIGPLAN, unless they prefer to opt out during their application.

The workshop registration is open to all. Students with alternative
sources of funding are welcome.

APPLICATION for PLMW scholarship:

The scholarship application can be accessed from the workshop web site
(http://plmw2014.inria.fr/). The deadline for full consideration of
funding is 10th December, 2013. Selected participants will be notified
from Friday 14th December, and will need to register for the workshop by
December 24th.

SPONSORS:

Facebook
Google
Jane Street
Microsoft Research
NSF
SIGPLAN

R7RS-small draft ratified by Steering Committee

R7RS-small draft was ratified by Steering Committee a few days ago at the Scheme 2013 workshop.

The announcement is here.

The final draft is here (PDF).

Incremental parser based on invariant syntax fragments

Dear LtU community,

Currently I'm working on combinator of incremental recursive descent parsers based on PEG grammars. And I would like to share my approach with you.

By the term "incremental" here I mean that the resulting parser is able to continue parsing process from any point of source code. i.e. parsers that are usually used in code editors and IDEs for live coding.

Briefly the problem is that performance of ordinary parsers is O(n) in best case, where n is the size of the source code. And we want to optimise the parser to work in O(m) approximately, where m is the size of incoming changes in the code.

Primitive solution for this problem would be memoization of AST. And binding each cached node to appropriate rule. Then running the parser again to reconstruct AST branch that covers changed part of the code.

However this approach has two disadvantages:

1) It is hard to determine which of the parental AST branch better fits to cover all the implications of changes in source code. Of course we can try each parental branch one by one from the deepest descendants up to root. But each parse try may cost additional computation efforts.

2) Another controversial problem is how to choose which nodes to memoise in order to get better performance and to save memory. Caching all nodes is overmuch.

My solution is to cache only the nodes that strongly cover invariant syntax fragments. "Invariant" means that regardless fragment's internal content it will always be parsed by the same parsing rule. And the internal content don't have any affects to the code outside it.

The example of such fragments could be parenthesis in C-like languages. More specific example is a code between function's arguments. No matter what this fragment consists of, it can always be parsed by a function's argument parsing rule only.

Fortunately selection process of such fragments between simple tokens can be performed by State Machine before the Syntax parse stage. And therefore could be easily put on incremental basis as well.

I have implemented the parser combinator in Scala language, and published it on GitHub. Also there is a blog post with some additional details. Here I also want to mention that library supports error recovery mechanism, and provides API to parse precedence operator expressions with Pratt algorithm.

I will be glad to hear any feedback from you on this approach.

Also I would like to know was this approach applied before in other products? Or at least described theoretically in papers? If so I would like to refer to them in my work. Or maybe it is quite unique? Should I try to publish more formal article then?

Thanks in advance.

XQuery transition to functional programming language complete ?

With XQuery 3.0 support of first class functions and a whole host of other fp goodness

http://www.w3.org/TR/xquery-30/

be interested in comment here if 3.0 is missing anything.

Having a small fp language work on declarative markup (as well as json, text, etc) is a powerful idiom.

I am sure I am demonstrating ignorance, but I am not aware of a similar(dynamic, typed) programming language that embodies fp principles so concisely.

Strong Mathematical Foundations for Computer Science

Mathematical foundations of Computer Science (CS) require great power as well as extreme rigor because of the requirement that computer systems be able to carry out all reasoning including reasoning about their own reasoning processes. The mathematical foundations of CS have important economic and security consequences.

Following a suggestion of [Scott 1967], mathematical foundations for Computer Science (CS) should be built on *both* types *and* sets:
* “there is only one satisfactory way of avoiding the paradoxes: namely, the use of some form of the theory of types... the best way to regard Zermelo's theory is as a simplification and extension of Russell's ...simple theory of types. Now Russell made his types explicit in his notation and Zermelo left them implicit. It is a mistake to leave something so important invisible...”
* “As long as an idealistic manner of speaking about abstract objects is popular in mathematics, people will speak about collections of objects, and then collections of collections of ... of collections. In other words set theory is inevitable.” [emphasis in original]

A natural way to proceed is to construct sets from characteristic functions by composing function spaces on ℕ (as axiomatised by Dedekind/Peano). Proceeding in this way, every set has finite rank. (The foundations of CS don’t seem to need the higher cardinals.
However, theories of higher cardinals can be axiomatised in the foundations.) Sets in the foundations are categorical in the type Sets◅ℕ▻, which is not a set (meaning that sets have been automatized up to isomorphism with a unique isomorphism). Categoricity is important for computer systems that reason model theoretically in order to avoid security holes. See “Formalizing common sense for scalable inconsistency-robust information integration” at Formalizing Common Sense.

Computer Science needs strong foundations that go far beyond the capabilities of first-order logic. For example, that a computer server provides service(i.e. ∃[i∈ℕ]→ ResponseBefore[i]) in the Actor Model) cannot be proved in a first-order theory.
Proof: In order to obtain a contradiction,suppose that it is possible to prove the theorem that computer server provides service (∃[i∈ℕ]→ ResponseBefore[i]) in a first-order theory T. Therefore the following infinite set of sentences is inconsistent: {⌈¬ResponseBefore[i]⌉|i∈ℕ}. By the compactness theorem of first-order logic, it follows that there is finite subset of the set of sentences that is inconsistent. But this is a contradiction, because all the finite subsets are consistent since the amount of time before a server responds is unbounded
∄[i∈ℕ]→ ⊢T ResponseBefore[i]).

For further discussion, see “What is Computation? Actor Model versus Turing’s Model”.

Let Peano be the Peano/Dedekind theory of the natural numbers with the following strong induction axiom:
∀[P:Booleanℕ]→ Inductive[P]⇨∀[i∈ℕ]→ P[i]
where Inductive[P]⇔P[0]∧∀[i∈ℕ]→ P[i]⇨P[i+1]

Of course, there are inferentially undecidable propositions Ψ such that
⊬PeanoΨ, ⊬Peano¬Ψ, and ⊨ℕΨ. But this is not fundamental defect of the theory Peano (regardless that ℕ is the categorical model of Peano) because in practice, proving ⊨ℕΦ requires proving ⊢Peano Φ.

The exact nature of the inferentially undecidable propositions of Peano is currently a matter of great controversy. See “Mathematics Self Proves its own Consistency”.

Wolfram Language

On Wolfram's blog. What is it? Will it be as revolutionary as claimed or will this just be another new kind of science? Reading the blog, it looks like they are banking on (a) a very rich library and (b) a cloud-based but built-in knowledge base akin to what you might get with F# type providers.

A simple interchange format for syntax trees of any language

A few months ago I wrote an article on CodeProject detailing my plans for my parser generator and the abstraction it will build upon, something called Loyc trees and LES, hoping to get feedback on my ideas.

I didn't get a single comment, though. I think now that I was just talking to the wrong crowd, and that perhaps the LTU will have richer things to say. Basically LES is an interchange format for syntax trees ("XML for code", I like to say, but since the syntax is concise and intuitive-ish, it's more like "YAML for code"), and Loyc is a project for converting code between programming languages and making source code easier to process by mere mortals. (Plus, I'm developing a programming language called Enhanced C# and would welcome advice about making a hygienic macro system.)

So, I hope you guys will find my idea interesting and offer your feedback. The most up-to-date summary of my ideas are on the Loyc wiki:

Loyc trees: https://github.com/qwertie/LoycCore/wiki/Loyc-trees
LES: https://github.com/qwertie/LoycCore/wiki/Loyc-Expression-Syntax

And if anybody's interested in a parser generator for C#, LLLPG is getting close to finished now.

Why is Static Typing Hard?

I’m working on a statically typed language and finding it slow going. In the history of dynamically vs. statically typed languages, it seems there is a trend: dynamic languages are implemented in a weekend, and refined iteratively for 10–20 years thereafter—static languages are defined and implemented over the course of 10–20 years, after which they’re basically complete.

The disparity is astonishing! Why do expressive static languages seem so much more difficult to implement? I contend that the field of type theory is not mature enough to answer the questions that dynamically typed languages ask.

Static typing and direct AST manipulation

Is this possible? Have static typing, meaning all types are defined at compile time, and at the same time have direct read/write access to the abstract syntax tree of the program?

Maybe this is possible if type definitions are not part of the AST.

Maybe I am missing or confusing sth. here...

Let me ask a more practical question: How would ANSI C, as an example, would have to be extended in order to provide direct read and write access to the abstract syntax tree at runtime while not loosing its compile-time type-checking feature.

edit: I like to clarify that what I mean by "AST" is not nessessarily a datastructure representing the entire program's contents but can also be seen as a typed representation of the program's entities: e.g. the language exposes the functions etc. as editable values. So the question is: If the program entities (is there a better word?) may be manipulated at runtime, is it still possible to type-check the program at compile-time? Or what restrictions must be applied to the access in order to not loose the compile-time-check-ability.

XML feed