Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

9
A brief introduction to stack-based languages
Post Body

As words are processed, they have an effect on the eventual meaning of a statement. Perhaps the simplest kind of language would have exactly one meaning discussed at any given time, and each word modifies that one meaning, possibly replacing it when something else comes up. However, this presents an obvious problem in discussing multiple concepts at once.

A solution to this problem is to consider the one meaning from before as a "stack" of meanings, with more recently discussed ones on the top, so we can have as many as we like (or care to process as speakers and listeners). For example, suppose our words for numbers simply introduced the concept of that number. Then, saying

2 3

would leave the concept of 3 at the top, followed by 2 below. This is because 2 was said before 3, so its "stack effect" comes before as well.

There's no point to having multiple concepts if we can't use them, however, so let's add some arithmetic words: - * /. Now if the sentence was

2 3  

we would be left with the concept of 5, so simply saying 5 would have the same stack effect. We can build up more complex expressions like

2 3   5 4 -   2 -

I'll put the current stack in parentheses after each word's stack effect occurs:

2 ( whatever came before -> … 2 <- top of stack )
3 ( … 2 3 )
  ( … 5 )
5 ( … 5 5 )
4 ( … 5 5 4 )
- ( … 5 1 )
  ( … 6 )
2 ( … 6 2 )
- ( … 4 )

and so the meaning of the whole phrase is "4", along with whatever happened before this whole sequence.

Some (maybe speculative) advantages to this are that:

  • …users of the language only need to concern themselves with the meanings in the conceptual stack, rather than keeping track of how various sentence forms might play out.
  • …"bracketing" words are never necessary in compound expressions like this; notice how we can write any arithmetic expression with those four operations without ever using parentheses.
  • …every word has a well defined effect, which makes computer processing much simpler and using the language (in my opinion) more intuitive.

I'm planning on writing a part 2, which will discuss

  • "stack shuffling" words, which rearrange the stack
  • quotation and evocation (unquotation) of phrases

and part 3 will probably be about

  • metaconversational words, which change how following words are processed
  • defining new words

As always, please leave your comments, questions, and suggestions below. Thank you for reading!

Author
Account Strength
90%
Account Age
11 years
Verified Email
Yes
Verified Flair
No
Total Karma
4,207
Link Karma
718
Comment Karma
3,489
Profile updated: 5 hours ago
Posts updated: 7 months ago
/r/sika (en) [es fr ja]

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
9 years ago