- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Scala Internals
Devoted to discussions about internal design and implementation of the Scala system.
Operational Semantics for Scala language
Hello,
I've been recently using Scala to implement a modelling language. Specifically, we have been using Actor library and the now we want to add the concept of continuations introduced by reset/shift construct by Scala. In this regard, we're interested to study the operational semantics of Scala if there is any document/reference/publication that addresses a formal specification of operational semantics for the language apart from the paper for ICFP'09. Is there any?
Thanks in advance,
Behrooz
I've been recently using Scala to implement a modelling language. Specifically, we have been using Actor library and the now we want to add the concept of continuations introduced by reset/shift construct by Scala. In this regard, we're interested to study the operational semantics of Scala if there is any document/reference/publication that addresses a formal specification of operational semantics for the language apart from the paper for ICFP'09. Is there any?
Thanks in advance,
Behrooz
Scala Meeting Report 2012/02/14
This summary is intended for Scala contributors and maintainers, and assumes a certain familiarity with Scala's internals.
It is for your information only, provided “AS IS” with no warranties and it confers no lefts (or rights).
<
???
hi,
just stumbled over http://ochsenreither.posterous.com/whats-new-in-210, and i'm quite excited at the outlook of scala 2.10.
i know `Predef.???` is an old thread, i just wanted to add that SuperCollider has a more verbose but very nice method for this:
notYetImplemented { NotYetImplementedError(nil, this).throw; }
i think this makes much more sense than `???` and also `undefined` (which is confusing with respect to partial functions, sets, maps etc.).
so you'd have
class X {
def aMethod: Int = notYetImplemented
}
best, .h.h.
Case classes: mmap(vparamss)(copyUntyped[ValDef])
I've found this funny line next to caseClassCopyMeth, and it makes me
sad.
The point is that the only ValDefs I can produce in the reifier are
the ones with TypeTrees, which will be happily erased by UnTyper. But
if that happens, then a few moments later case TypeTree() in
isRepeatedParamType will crash with NPE, which is a symptom of a
systemic problem - reified types are sometimes erased by subsequent
reflective compilation.
What do I do with that? Is it possible to patch UnTyper so that it
preserves reified types?
that was too much lub(), N-1 to be precise
Today I noticed something interesting in the dataflow algorithm we use. There's room for improvement.
After applying the transfer function to a basic block to obtain a lattice element `output`, we proceed to update the inputs of successors as follows:
lattice.lub(in(p) :: (p.predecessors map out.apply), p.exceptionHandlerStart)
ie. all predecessor's outputs are lub-bed (besides the only one that changed, N-1 other lattice elems are lubbed, whose effect is already accounted for in `in(p)`)
The result doesn't change by leaving out those N-1 redundant inputs:
lattice.lub(List(output, in(p)), p.exceptionHandlerStart)
How to detect errors in compiler-generated code?
Hi Hubert,
I am trying to get value classes working, and stumbled on a problem
this morning. I
was trying to create an array of two Meters, where Meter is a value class.
class Meter(...) extends AnyVal ...
val x: Meter
val arr = Array(x, x + x)
It crashed in superaccessors because a generated manifest contained an
error value (stacktrace appended). The problem was clearly that
superaccessors should not have been run because typer produced an
error. But that error was never reported.
Get a symbol by its owner and its name
Is there a way to get a symbol if I know its owner and its name?
Positive answer will be very useful for importers (that provide
bijection between universes, e.g. between reflective mirror and
reflective compiler).
Currently importers create a new symbol for every symbol they haven't
seen yet. This means that certain symbols can be created multiple
times - once inside their own universe and once again during an import
from a universe that already has the same symbol.
Scala Compiler Performance Analysis
Hi All,
Not sure you all have seen this but we've been publishing a series of
articles on the performance analysis of the existing 2.9.1 scala
compiler code base. We did not set out to address all performance
concerns of the compiler but to look at the issues one has in measuring
(in our case metering) scala derived class bytecode. There has been a
lot said about complexity but rarely has this actually looked at how
does one make sense of the execution of such bytecode when traceability
back to source and constructs is not as easy as it has been in Java
itself with the mapping being explicit, direct and immediate.









