Thanks to everyone involved in the definition and commitment phases for Programming Language Design and Implementation on Area 51, the community has made it into the private beta phase — congratulations! Now that Programming Language Design and Implementation is in private beta, there is still wo...
A stack-based language necessarily contains at least "push" and "pop" instructions. However, these typically aren't the only ways to manipulate the stack. For example, several languages have an instruction to swap the two values at the top of the stack. Trilangle has an instruction to look arbitr...
@lyxal That's something you may want to meta as well. List questions can get out of hand quickly, it's up to the community how they want to deal with questions that have 24+ valid answers.
Note that this is not a discussion over whether catalogue questions are on-topic
Questions like What are the syntax options for implementing a ternary "if" operator? and What operations are common in stack-based languages? are prone to having a multitude of valid answers. Such questions are "cata...
What are the advantages of conditionals having their own scope? I know this can lead to some extra variables for some programs. But it can also be more memory efficient.
Credit to Hg0428 for the idea on A15
I heared that C# has a generational garbage collector which makes it faster than a conventional one. I want my language to be fast so using one seems a good idea, but I'm failing to understand what it even is before I can implement one.
I found this on Wikipedia:
A generational GC (also known as...
In a lot of older C-family languages, lines of code must be ended with an explicit character (generally a semicolon). However, newer languages support inferring where line-endings should go. What are good parser rules to use for inferring line-endings?
On the subject of associativity when all operators have equal precendence, Ken Iverson writes in Conventions Governing Order of Evaluation that
The reasons for choosing a right-to-left instead of a left-to-right convention are:
The usual mathematical convention of placing a monadic function to ...
Different languages have different naming conventions for their modules. For example, Java-family languages usually use full reverse-domain-name names for packages (ie com.example.examplemodule). Python, however, lets you name your modules whatever you want. What are the pros and cons of these me...
My language is expression based; many of its language constructs are not statements, but rather expressions that return a value. However, since everything is an expression, my grammar looks like
code := stmt*
stmt := expr ';'
expr := var | loop | if | ... | literal | ident | block
block := '{'...
According to the Wikipedia article on Smalltalk,
| window |
window := Window new.
window label: 'Hello'.
window open
If a series of messages are sent to the same receiver as in the example above, they can also be written as a cascade with individual messages separated by semicolons:
Window new
...
I suppose it depends which community you want to hear from: people who primarily golf, and in a variety of languages, or people who primarily design a variety of languages
Ones like that relevant to actual golfiness may do better on CGCC, while ones about parsing/interpreting/community should def. go here
There are currently two sites where questions about golfing languages (languages designed to be as compact as possible) are definitively on-topic:
This site
Code Golf & Coding Challenges
What should be considered when deciding whether to post a golflang question here vs. on CGCC?
I've never used Vyxal, never contributed to it in any way, and have VyxalBot blocked on GitHub for some reason.
Like a year and a half ago Vyxal may have had some annoying contributors doing annoying things, but that's just because it was designed to be appealing to new and young golfers...the same group that's likely to be less mature.
@mousetail and you can't really see it from the outside either - for the people still active in the chat room, they aint the kind of people to start yelling at you the moment you express a negative opinion about the language
In languages like Java that use type erasure for generics, some casts are considered unchecked. One example is casting a value of Object to List<String>. On the other hand, casting from Iterable<String> to List<String> is allowed because the type parameter matches. Casting Object to List<?> is al...
Quick CMP: (chat mini poll) My current First Answers/First Questions policy is just doing any voting/commenting I'd do normally then clicking "Looks OK", since most people here are from the commit stage and thus aren't really new to the site. Should I (and other reviewers ig) start using welcome comments, or should that wait until public beta?
Oh since some people here might not have been in TNB before, quick CMx reference: CMx stands for Chat Mini [x]. CMC is for "challenge" (typically code golf in TNB), CMQ is for question (general questions), CMP is for "poll", and CMM is for meta (questions about the site that're too small to be worth a meta question)
Maybe then javascript is like coffee but with the grounds left in, so you need to constantly watch out not to touch the bad bits but if you manage to avoid them it's not that bad
From Wikipedia:
In certain computer programming languages, the Elvis operator, often written ?:, is a
binary operator that returns its first operand if that operand
evaluates to a true value, and otherwise evaluates and returns its
second operand.
For example in Kotlin, foo ?: bar will yield fo...
I'm implementing my own statically-typed programming language and I'm not too happy with my own approach to types. At the moment, I'm relying on mapping a textual representation of a type to an index in a hash map, and then trying to parse that for "sub types" (for things like "arrays of a type", "...
Since tokens only really make sense in the context of lexing, but as a tag for lexing, it's harder to discover and more likely to be used for the wrong thing
Some tags for specific types of tokens would make sense to me tho
Various questions on main currently have the tokens and characters tags. Which tag should be used where is not clearly specified, and their meanings have some overlap. What should we do with them?
Most languages, at least any vaguely derived from C, have the following rules for identifiers:
Must start with a letter or underscore
All characters after the first can be a letter, number, or underscore
Many languages add additional allowed characters to this. JavaScript allows $ at the start ...
There seem to be two main ways that languages handle the same concept:
Nullable types, like Kotlin, C#, and many other OOP languages
Options, like Rust and Haskell, which are wrappers around a type that can either be Some(...) or None (or equivalent names)
While these serve similar purposes, th...
We already had a chat about pros-cons over here, and I can see the reasoning for keeping it around for this site... But we've also got a multiple-answers tag that I really don't think we should keep around.
We're early in private beta, I know, but I do think that drawing a line around what a "good"...
In most modern languages, string literals can use either single (') or double (") quotes. Are there any reasons to distinguish between the two, and if so what would the other kind be used for?
Programming Language Design and Implementation has a very long name. It might actually have the longest name of any SE site, although I can't be bothered to check. This leads to situations like Weird padding on the VTC privilege notice, where the extreme width of the name causes weird UI issues l...
Yeah it's basically to say "you've contributed enough today, go home", so that people don't burn themselves out or get massive amounts of rep in a tiny time period
I'd like to have both a safe navigation operator and monad unwrapping operator.
Safe navigation is like the feature in TypeScript:
Some(k)?.property == Some(k.property)
None?.property == None
This is very useful for transversing nested structures with members that may or may not exist.
However, ...
Going off of this question about the difference between nullable types and optional types, I notice that no mainstream dynamically typed language has ever gone for an explicitly-boxed Option type. Python, Ruby, and Javascript all have null values, called (respectively) None, nil, and null.
Obviou...
I'm preparing to write a question asking whether the extra work needed to support very helpful compiler error messages, such as what Rust supports, all that beneficial (phrased a bit differently than that- "Are very explanatory compiler error messages worth their weight in work needed to support them?"), and I'm wondering if that would be on-topic for this site.
Since that's, technically, about the compiler and not necessarily about the language