Stack Exchange
log in sign up chat discuss faq users badges

Area 51 » Technology

definition commitment beta
207
followers
Share This

Programming Language Design and Implementation

Beta Q&A site for designers and implementers of computer programming languages

13
votes
5
answers

What is a programming language?

may 15 at 0:18 Solomon Ucko 151
5
votes
0
answers

PLDI's current chat room

apr 26 at 19:28 Radvylf Programs 2,334
28
votes
1
answer

Congratulations to Programming Language Design and Implementation on completing the Commitment phase!

apr 26 at 18:03 Deko Revinio 112
9
votes
1
answer

Should we allow questions about other parts of the software toolchain?

mar 20 at 20:47 V2Blast♦ 186
7
votes
3
answers

Will questions about building and maintaining a programming language's community or contributors be allowed?

mar 8 at 15:51 warren 7,720

show 17 more discussions
discuss this proposal

This proposal is now in the Beta phase — example questions are locked!

115 Example Questions (7 closed)

active newest votes
up vote -1 down vote
When should I write for my own virtual machine instead of use a existing one?
added by mousetail Nov 18 '22 at 13:37
link
1  
This could be improved by changing from "why" to "when" – warren Dec 5 '22 at 16:55
1  
@warren thanks, good tip – mousetail Dec 5 '22 at 17:12
I removed my downvote. If this gets closed, I'll nominate for reopening – warren Dec 5 '22 at 21:30
up vote -1 down vote
What's different about designing a shell language (e.g., Bash, PowerShell)?
added by BoppreH Nov 18 '22 at 18:23
link
2  
I don't understand the close votes here. There are obviously different things that a shell language should consider. – Nathan Merrill Nov 18 '22 at 21:23
4  
This is too vague, as there are many different possibilities – Seggan Nov 19 '22 at 14:34
2  
"different" from ... what? An esoteric language like ws? A compiled language like Fortran? "different" in what way(s)? Powershell famously gives access to the .NET framework, for example, but in scriptable form – warren Nov 23 '22 at 13:11
@Nathan Merrill maybe it's not as obvious as you think – warren Dec 1 '22 at 13:49
2  
I still disagree here. Shell languages do have unique considerations because they focus on executing other commands. You want to optimize how easy it is to copy/paste a console command into your shell language, for example. Fundmentally, I think the question of "I want to do X well. What considerations are there in this space?" is a great question. – Nathan Merrill Dec 1 '22 at 19:42
up vote -1 down vote
What are the advantages of a visitor pattern when traversing my AST?
added by bigyihsuan Nov 18 '22 at 19:27
link
up vote -1 down vote
Should I represent strings internally always in one encoding (like Python/JS/Java) or allow different encodings depending on the source (like Ruby?)
added by finnw Nov 22 '22 at 22:52
link
3  
Actually, the internal string representation in Python and JS is often chosen dynamically, though it isn’t exposed to user code. So the premise behind the question seems false. – user3840170 Nov 23 '22 at 17:02
up vote -1 down vote
How do I determine if my new language is Turing Complete?
added by Robert Columbia Nov 23 '22 at 17:25
link
1  
I’m not sure if this question makes sense to ask as written here, but slight rephrasings of it may be fruitful (for example, when designing a language with the goal of it not being Turing complete). – user3840170 Nov 26 '22 at 10:37
2  
I think being able to say your language is Turing complete is mainly a marketing thing - people want to know whether your language can do X, and you can tell them "yes, it can do everything every other Turing complete language can". In practice being Turing complete is not really a good indicator of how expressive the language is, but some people like to know about it (either because it's the bare minimum they expect from a language, or because they find it interesting that a non-programming language like CSS3 is Turing complete.) I don't know if that makes the question suitable or not. – kaya3 Dec 3 '22 at 9:35
May be better worded, "when is it OK for a language to not be Turing Complete"? – warren Dec 12 '22 at 17:53
1  
@warren that would be even more subjective – mousetail Jan 7 at 16:25
@mousetail - perhaps. – warren Jan 9 at 18:42
show 2 more improvement suggestions
up vote -1 down vote
Should {ifs} have their own scope? What are the advantages/disadvantages of this?
added by Hg0428, edited by warren Dec 5 '22 at 16:01
link
1  
This seems a bit too wrapped up in other language design choices. – Unrelated String Nov 28 '22 at 4:00
1  
"Best" is subjective. This would be better if it were purely about advantages/disadvantages, and probably if it were broken into smaller questions (like if the bodies of conditions/loops should be their own scopes, if function scoping should exist, etc.) – Redwolf Programs Nov 29 '22 at 19:48
Edited from the original "What is the best system to use for scoping? Should ifs have their own scope? What are the advantages/disadvantages of this?" to a generalized format. – warren Dec 5 '22 at 16:01
up vote -1 down vote
What language features must be avoided to ensure that a compiler can clearly determine whether or not a function is pure?
added by Philipp Dec 2 '22 at 13:15
link
probably better phrased positively: "How do you design a language so its compiler can tell whether or not a function is pure?", maybe? – cjquines Feb 5 at 10:23
up vote -1 down vote
What's best practice for injecting language runtime code? If I need things like memory management, does that go in the AST during AOT compilation?
added by marcantonio Dec 5 '22 at 1:57
link
up vote -1 down vote
How can I implement a compiler for {C++} that will compile to JVM bytecode to improve portability?
added by warren Dec 6 '22 at 21:20
link
up vote -1 down vote
How can a "glue" scripting language be designed to scale gracefully to larger projects?
added by Unrelated String Dec 11 '22 at 22:53
link
up vote -1 down vote
What is a correct compiler?
added by NaCl Dec 14 '22 at 18:37
link
4  
This… sounds a little like a grammatical mistake unless you know that “compiler correctness” is a thing. Which might be why somebody downvoted this? – brendanzab Dec 15 '22 at 9:18
Rather than what it is, perhaps we could have a question about something specific that comes up when implementing such a compiler? – Original Original Original VI Jan 27 at 1:32
The question is phrased this way since compiler correctness is a spectrum. I think it does make sense to ask what a suitable correctness criterion for a compiler is, rather than how to realize a correct compiler. These are two different pairs of shoes – NaCl Jan 27 at 11:31
up vote -1 down vote
How to decide about reserved words: none, well-defined namespace, a very small number, only occasionally create new ones, don't worry about it, etc.?
added by Ray Butterworth Dec 25 '22 at 16:31
link
up vote -1 down vote
How much should users have behind the curtain access? (e.g. C is very much like assembler, allowing fine control and even possible abuse).
added by Ray Butterworth Dec 25 '22 at 16:36
link
think question would be better with a clearer definition of "behind the curtain access". how is this different from being turing complete – cjquines Feb 5 at 10:22
How does one fit a clearer definition into the remaining 12 characters? It's nothing to do with Turing. Being able to cast the pointer type in C is an example of something that can provide great efficiency but can also allow disastrous mistakes. Accessing the top bits of a floating point number to get the log of its magnitude works wonderfully, at least it does until the hardware changes. – Ray Butterworth Feb 5 at 14:56
up vote -1 down vote
What are the downsides not specifying the datatype of a variable when creating it?
added by RedzGoose Jan 10 at 8:25
link
"specify" is unclear. Are you talking about the absence of explicit mentions of type in the source code (non-manifest typing)? Or are you talking about the lack of compile-time type verification (dynamic typing)? It's entirely possible for type to be both inferred and static, as in Haskell-family languages. But in another sense, even Python "specifies" datatypes, in that values have types even if variables (names) don't. – Anonymous Jan 12 at 19:33
up vote -2 down vote
How can a complicated parser be implemented in a single pass?
added by Redwolf Programs Nov 17 '22 at 23:02
link
3  
What is a complicated parser? – user3840170 Nov 19 '22 at 12:19
up vote -2 down vote
What are the pros and cons of implementing enumerated unions in my language? [closed]
added by fess, edited by AAM111 Nov 25 '22 at 20:31
link

closed as not constructive by Ethan, Nij, curiousdannii, user3840170, Bubbler Nov 21 '22 at 6:12

This question is not a good fit to our Q&A format. We expect answers to generally involve facts, references, or specific expertise; this question will likely solicit opinion, debate, arguments, polling, or extended discussion.

4  
I think this needs to be more objective. It's more like a poll, while a good question for SE's format would be more like "what are the advantages of..." – Redwolf Programs Nov 18 '22 at 16:05
1  
I edited the question to make it more objective, and voted to reopen. – AAM111 Nov 25 '22 at 20:31
up vote -2 down vote
Are macros as a language design choice worth it or do they complicate the language more than they simplify writing code?
added by fess Nov 18 '22 at 15:34
link
3  
This could be an okay question, but not phrased like this. – user3840170 Nov 20 '22 at 7:12
up vote -2 down vote
Which resources are available for implementing a strong type system?
added by themisir Nov 18 '22 at 18:21
link
up vote -2 down vote
How can I parse a recursively-nestable unary expression (such as `not not ... not X`) into an AST?
added by bigyihsuan Nov 18 '22 at 19:56
link
Questions containing ‘this’ in the title are usually poor ones. – user3840170 Nov 20 '22 at 7:10
I've since changed it to a more general question about nestable unaries. – bigyihsuan Nov 20 '22 at 18:26
up vote -2 down vote
Are there any guides for how to compile a garbage collected language and how to integrate a garbage collector? [closed]
added by Jeremy Nov 18 '22 at 21:10
link

closed as not constructive by Nathan Merrill, Ethan, Mark, curiousdannii, James Risner Nov 20 '22 at 20:34

This question is not a good fit to our Q&A format. We expect answers to generally involve facts, references, or specific expertise; this question will likely solicit opinion, debate, arguments, polling, or extended discussion.

1  
This could be improved by removing the reference to "guides". Additionally, I think there are really two questions in one here: What are the different GC algorithms, and how do runtimes work? – Nathan Merrill Nov 18 '22 at 21:22
up vote -2 down vote
What is the best approach in terms of speed for storing and lexing a template string?
added by TKirishima Nov 18 '22 at 23:20
link
1  
What is a template string? – user3840170 Nov 19 '22 at 12:10
@user3840170 I think it's like f"" strings in python or ${} strings in javascript. Strings with a spot to insert expression in that will be evaluated at runtime. – mousetail Nov 19 '22 at 18:06
1  
The point though is that this isn't necessarily a universally-understood term; it's specific to JavaScript. Terms like ‘interpolation’ or ‘formatting’ would be more language-agnostic. – user3840170 Nov 19 '22 at 18:21
3  
I think template string is well understood to include the PHP, python etc. equivalents. – mousetail Nov 20 '22 at 12:06
1  
formatting isn't that. String formatting: is "%d = %s". And as said by Mousetail, this term is also used in other programming languages such as PHP. – TKirishima Nov 20 '22 at 17:11
show 1 more improvement suggestion
up vote -2 down vote
What are some factors for choosing a suitable AST to fit my language? [closed]
added by mcneb10 Nov 19 '22 at 20:04
link

closed as not constructive by curiousdannii, Ethan, kaya3, Ginger, warren Dec 5 '22 at 16:00

This question is not a good fit to our Q&A format. We expect answers to generally involve facts, references, or specific expertise; this question will likely solicit opinion, debate, arguments, polling, or extended discussion.

up vote -2 down vote
What limitations prevent a language focusing on brevity in syntax while allowing general purpose use with limited restrictions on operations? [closed]
added by James Risner Nov 23 '22 at 3:51
link

closed as not a real question by user3840170, Robert Columbia, Seggan, warren, double-beep Dec 15 '22 at 5:11

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form.

1  
What does ‘perform most task like C’ mean? – user3840170 Nov 23 '22 at 17:00
General use, not limited in capabilities. I’m not sure the best way to phrase that. In other words, if brevity limits capabilities pull back a little. – James Risner Nov 23 '22 at 17:56
2  
The phrasing of the question is unclear – Seggan Nov 23 '22 at 23:12
1  
@JamesRisner much better – Seggan Nov 24 '22 at 1:02
2  
@JamesRisner I think its just the fact that this question is vauge – Seggan Dec 1 '22 at 16:00
show 4 more improvement suggestions
up vote -2 down vote
Should I use double quotes ('foo''bar') or use a backslash and a quote ('foo\'bar') to escape quotes? What are the advantages/disadvantages of this?
added by Fmbalbuena Dec 21 '22 at 2:54
link
up vote -2 down vote
What are criteria for deciding whether something should be in the language or in a library? (string, linked list, complex number, sparse array, etc.)
added by Ray Butterworth Dec 25 '22 at 16:19
link
This would definitely be closed as needing more focus on the actual site. – damryfbfnetsi Jan 12 at 7:02
1  
Why the down and close votes? FORTRAN decided complex numbers were part of the language, C decided that they should be handled by libraries. This question is asking about how such decisions are made when designing a language. – Ray Butterworth Jan 13 at 21:38
up vote -2 down vote
Can I safely assume that a byte has a size of 8 bits?
added by stackprotector Jan 16 at 18:12
link
2  
Who is "I"? A language designer can safely assume whatever they want, or rather they record their assumptions as definitions; it's up to the language implementer to make it reality. – Ray Butterworth Jan 17 at 22:21
up vote -3 down vote
What are the pros and cons of non-ASCII operators?
added by Adám Nov 18 '22 at 13:35
link
1  
Maybe asking about pros and cons makes the question more objectively answerable. Other than that, I think it's a perfectly fine question about the "design" or "developer experience" side of programming language design. – Bubbler Nov 21 '22 at 6:18
up vote -3 down vote
How much can syntactic sugar in my language increase the difficulty of implementation?
added by bigyihsuan Nov 18 '22 at 20:05
link
2  
I think this one is too subjective. It depends on what syntactic sugar and the target platform of your language. – Seggan Nov 18 '22 at 20:19
1  
I don't see how it can ever depend on the target platform, since the definition of "syntax sugar" is language syntax whose meaning is defined in terms of other language syntax, rather than whose meaning is defined directly. Syntax sugar can therefore be implemented by transforming the AST. Generally syntax sugar is used to decrease the implementation difficulty, since it allows you to have a richer syntax without creating more node types for the compiler backend to have to handle. – kaya3 Nov 19 '22 at 3:07
Sorry, I misunderstood the exact definition of syntax sugar. You are correct. However, my first argument still partially holds. – Seggan Nov 19 '22 at 14:36
2  
define "syntactic sugar" - one man's core requirement is another woman's "nice to have" – warren Nov 21 '22 at 13:51
3  
Syntactic sugar causes cancer of the semicolon. – Robert Columbia Nov 23 '22 at 17:26
up vote -3 down vote
What are the pros and cons of using an SBCS for a programming language?
added by TKirishima Nov 18 '22 at 23:27
link
1  
If you downvote this question, can you please explain why? – TKirishima Nov 20 '22 at 17:13
What is a SBCS? Sounds like more than one question? (If answered the answer would be long). – James Risner Dec 3 '22 at 18:27
(SBCS = single byte character set) – somebody Jan 28 at 15:18
up vote -3 down vote
What are some simple, existing Virtual Machines to write languages for?
added by kouta-kun Nov 19 '22 at 19:48
link
up vote -3 down vote
What are the advantages/disavantages of stack-based languages vs not-stack-based languages?
added by justANewbie Dec 17 '22 at 5:45
link
Why is this being downvoted? There are successful stack based language, FORTH being most notable, which are pretty interesting. Altho this question could use some more specificity (e.g., advantages for performance, or readability?), I think it is a good one – Redwolf Programs Jan 16 at 0:48
Is Python a stack-based language, or a not-stack-based language? CPython complies it down to a stack/register machine, but you could easily take out the register instructions. – wizzwizz4 Jan 29 at 19:45
up vote -3 down vote
What should I consider when designing a new language?
added by justANewbie Dec 17 '22 at 16:44
link
This seems more opinionated than having a constant answer type of question which can lead to discussion or argument. Depending on what the user is trying to get in the finale, the question can be asked in different ways: If they are asking about things such as usability when others use it, "What does your experience with the usability of a new language generally conclude to?" might fit. Then it is no longer asking for opinions but factual results. – leguchi Dec 18 '22 at 15:08
I was trying to create a question that look like this: softwareengineering.stackexchange.com/q/46716 – justANewbie Jan 16 at 7:01
up vote -4 down vote
What are common ways to optimise an interpreted language? [closed]
added by emanresu A Nov 17 '22 at 23:48
link

closed as duplicate of What are common ways to optimise an interpreted language? by Adám, Ginger, lyxal , warren, UndoneStudios Nov 18 '22 at 14:06

This question covers exactly the same ground as another question in this proposal.

1  
You seem to have posted this question twice – mousetail Nov 18 '22 at 12:34
up vote -4 down vote
What reading materials do you recommend for programming language design? [closed]
added by Adám Nov 21 '22 at 8:27
link

closed as not constructive by Ethan, curiousdannii, kaya3, finnw, Mark Nov 24 '22 at 2:47

This question is not a good fit to our Q&A format. We expect answers to generally involve facts, references, or specific expertise; this question will likely solicit opinion, debate, arguments, polling, or extended discussion.

1  
This does not seem to be a question. If it is, please rephrase it so it sounds like one – Ethan Nov 21 '22 at 17:42
1  
It’s a question, it’s just that it’s a question that will likely result in opinions. Which are generally off-topic here. – James Risner Nov 23 '22 at 17:58
@JamesRisner Isn't every question here opinion-based? – Adám Nov 23 '22 at 18:37
3  
@Adám there are not supposed to be, no. Read area51.stackexchange.com/faq the "What makes a good question?" section – James Risner Nov 23 '22 at 23:04
1  
The problem with this kind of opinion-based question is that it's not asking for expert opinions - "what reading materials do you recommend?" can be answered by everyone who has any reading materials to recommend, whereas a question like "what are the downsides of lazy evaluation?" can only get a good answer from someone who has expertise on that subject. A good subjective question requires expertise to answer; a bad subjective question can be answered by anyone with a personal opinion, and hence the answers won't likely be useful to a lot of people. – kaya3 Dec 2 '22 at 13:45
up vote -5 down vote
What are the advantages and disadvantages of implementing a custom IDE? [closed]
added by emanresu A Nov 17 '22 at 23:31
link

closed as off topic by curiousdannii, kaya3, warren, Mast, James Risner Nov 30 '22 at 20:44

This question does not relate to the topic of the proposal.

2  
this has nothing to do with language design – warren Nov 21 '22 at 13:53
1  
@warren disagree, this can feed back into the language design process - if a language's quirks make it hard to write a LSP server for example, one might choose between implementing a custom IDE or simplifying the language so that popular editors are better suited to it. – finnw Nov 23 '22 at 10:34
prev 1 2 3

This site is in

Public Beta

Anyone can participate!

Sites remain in beta for at least 180 days to build up a critical mass of users, questions, and participation.

proposed by

Redwolf Programs
42.3k●9●181●470

10 months ago

edited by

warren
108k●95●535●1155

8 months ago

viewed

26,594 times

latest activity

3 months ago

followers

users also following

2.9% Proof Assistants
2.9% Drones and Model...
2.4% Matter Modeling
2.4% Quantum Computing
63.3% only this proposal

followers active in

43.5% Stack Overflow
22.7% Meta Stack Exchange
19.8% Code Golf
18.8% Programming Langu...
18.8% Programming Langu...
16.4% Mathematics

recent followers

added Jun 8 at 10:57
Petəíŕd
2,625●2●6●47
added May 15 at 7:01
user223895
51●1
added May 14 at 20:05
user223893
51●1
added May 4 at 21:11
Smitop
9,670●5●33●98
added May 1 at 20:59
user223868
51●1
added Apr 24 at 12:26
Skgland
1,013●10●25
added Apr 18 at 10:08
l0b0
165k●99●645●1140
added Apr 16 at 22:33
skreutzer
51●2
added Apr 16 at 21:04
saintali
5,437●2●33●68
added Apr 16 at 7:03
otesunki
51●2
added Apr 14 at 11:09
TheOnlyTails
51●1
added Apr 13 at 22:31
Matt and Neil
32.6k●7●102●184
added Apr 13 at 20:33
Jasmijn
13.4k●2●44●84
added Apr 13 at 14:18
Mark Glossop
51●1
added Mar 24 at 2:22
Franklin Zhou
51●1
added Mar 1 at 18:27
hazer-hazer
51●1
added Feb 16 at 14:52
The Thonnu
24.8k●9●34●175
added Feb 13 at 19:25
t0mm13b
49.8k●9●138●218
added Feb 8 at 11:50
Dangeroustuber
51●1
added Feb 5 at 21:50
Michael Kolesidis
658●1●4●20
added Feb 5 at 18:35
124816
51●2
added Feb 5 at 15:43
musiKk
22.6k●6●98●176
added Feb 5 at 10:17
Arduino Sentinel
3,279●23●54
added Feb 3 at 7:11
Maximilian Ballard
1,705●1●12●51
added Feb 1 at 18:37
user223486
51●1
added Feb 1 at 15:24
user223485
51●1
added Feb 1 at 12:23
user223483
51●1
added Jan 31 at 21:06
Mike C
34.1k●15●93●138
added Jan 30 at 10:15
Nimesh Neema ♦ 1
62.5k●27●211●338
added Jan 29 at 19:24
wizzwizz4 ♦ 1
51.3k●17●218●575
added Jan 29 at 9:39
user223477
51●1
added Jan 29 at 6:07
goomba
51●2
added Jan 29 at 0:35
Jacob
6,579●1●21●90
added Jan 28 at 15:15
Roan
1,351●2●19●35
added Jan 28 at 14:59
user223469
51●1
added Jan 25 at 20:12
taylor.2317
4,286●1●25●136
added Jan 25 at 17:18
warren
108k●95●535●1155
added Jan 24 at 5:06
just Paul
51●1
added Jan 23 at 11:24
user223454
51●1
added Jan 22 at 22:09
Riley Lynch
51●2
feed icon proposal feed
faq | blog | legal | privacy policy | contact us | feedback always welcome
site design / logo © 2023 Stack Exchange Inc; user contributions licensed under cc by-sa; see the licensing help page for more information.
rev 2023.9.22.623