A list of puns related to "Operational Semantics"
I am looking at some formal models for some languages. They provide definitions of types and operations. Is this enough to say that a language is formalized? Is there supposed to be a proof of some sort to say that?
Sorry, I hope you can go easy on me as this is my first time in the area and it's over whelming me.
Hey folks! I was reading a bit about computer science semantics and I'd like to make sure I understood correctly the definitions of the following types of semantics (operational, denotational, axiomatic) by mapping them to some very basic, real world examples.
Quick glossary of the terms in their most basic form:
Wikipedia's main article about: semantics.
This says that the meaning of a language construct is specified by the computation it induces. It is of interest how the effect of a computation is produced. My understanding of this is that this basically describes the meaning of all the operations involved in a program (from the most basic to the most complex).
Examples:
arithmetic operations: 1 + 1, 10 ** 2, 19 // 3
etc. In this case it analyzes the meaning of the steps involved in producing a result given n operands and n operators. This can be further boiled down to what each operand means (so in my examples each number is defined in the domain of natural numbers [1, 2, ..., n], etc.
assignment operations: x = 5, y = 5 ** 2, z = 10 ** 2 // 3 * (99 + 1024)
etc. In this case it involves an evaluation of the value of the mathematical expression on the right and assigning it to the identifier on the left.
augmented assignment operations: x += y, z *= t
etc. In this case it involves an evaluation of each identifier once, and performing an arithmetic operation first, followed by an assignment operation last.
etc.
This says that meanins are modelled by mathematical objects that represent the effect of executing the constructs. It is of interest only the effect of a computation, not how it is produced. My understanding of this is basically mathematical functions, which take something as an input, do so
... keep reading on reddit β‘Adm. Roscoe H. Hillenkoetter's briefing memo to President-elect Eisenhower concludes:
>Implications for the National Security are of continuing importance in that the motives and ultimate intentions of these visitors remain completely unknown. In addition, a significant upsurge in the surveillance activity of these craft beginning in May and continuing through the autumn of this year has caused considerable concern that new developments may be iminent. It is for these reasons, as well as the obvious international and technological considerations and the ultimate need to avoid a public panic at all costs, that the Majestic-12 Group remains of the unanimous opinion that imposition of the strictest security precautions should continue without interruption into the new administration. At the same time, contingency plan MJ-1949-04P/78 (Top Secret - Eyes Only) should be held in continued readiness should the need to make a public announcement present itself. (See Attachment "G".)
The contingency plan mentioned above is still classifed above top secret, although it is believed to be a strategy for managed disclosure in the event of the public coming to learn of the existence of alien technology or aliens by accident, or if aliens decided to land in a public area, or if sightings became too frequent and common to deny. Apparently the contingency plan was dismissed/shelved within a few months of MAJIC-12 forming, but it may be the case what we are seeing now is that contingency plan or a derivative thereof.
The game is to predict what is in the contingency plan.
My prediction is the government will move to plausible deniability (we don't know what they are but it could be dangerous/we need more time and money to research and investigate) when the truth is they are in actual possession and control of alien technology and EBEs, if not acting in concert with them.
A lot of examples of this operator are about how it saves some lines of code. What do you think about using it to make code more semantic?
For example:
if (sum := 10 + 5) > 10:
print(sum) #return 15
The code just works the same way without the assignment to sum
. But by introducing the variable sum
, it is easier to understand what the code does.
(5 min read)
Hello wonderful community,
It was surprising to discover from comments to my post about copy-on-write (COW) semantics that COW in the area of PLs is not such an exotic idea. Several actively used languages use COW, for example: Matlab, GNU/Octave, and, surprisingly, even Apple's Swift. So, I am now even more sure that I am on a right track (for the purposes of my language).
It was surprising also to discover how many people care about genuine old-school value semantics, which implies (deep) copying. So I thought it would be better to adjust slightly the terminology for the purposes of further discussion:
In a sense, in my PL, the default is COW, which is an intermediate point and is most useful in practice, IMHO. Nevertheless, you can easily access genuine value and genuine reference semantics too.
In this post I'd like to demonstrate more in details how those and related mechanisms work.
The point of COW is that only shared things are copied. So, when you are focused on run-time performance of your code (as opposed to what function it computes), it's important to occasionally break gratuitous sharing. The move operation serves that purpose: V!
. Technically, in MANOOL what it does is to assign to V
the value Nil
, and it evaluates to the previous value of V
. Note that V
may be an arbitrarily complex expression that denotes an assignable location (e.g., it may denote an element of an array). Let's see how it affects asymptotic complexity by trying to repeatedly concatenate strings:
{ var { S = "Hello" } in
: do S after -- return the result after performing the following
: repeat 1000000 do -- repeat one million times
S = S + "World" -- O(N), where N == Size[S]
}
Replace S = S + "World"
with S = S! + "World"
and you'll get amortized O(1).
A related feature is the in-place update syntax. In imperative-style code you often want to update a single element of a composite value. It's usually written as C[K] = V
. In MANOOL this is
Could you help me to understand how call
operation is expected to work in WebAssembly? Let's say there is wat code:
(module
(func $add (param i32 i32) (result i32)
local.get 0
local.get 1
i32.add
)
(func $main (export "main") (result i32)
i32.const 3
i32.const 7
call $add
)
)
It looks like call $add
(i.e., its actual implementation in wasm runtime) pops two values from stack, puts them to some function "locals storage" and jumps to $add
. The $add
pushes values from the locals to stack. Is my understanding correct?
Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.