12
\$\begingroup\$

This is the question that prompts this meta: Is my language easy/hard enough? How badly is it designed?. Paraphrased:

I am thinking about making a language somewhat based on macros, and looking somewhat like PHP. I will use it to produce Javascript and PHP code.

Here is an example or a factorial with recursion:

:define:&0:factorial
    :param:~0:static
    :case
        :lower@equal:cons@1
    :case:end
    :scope
        :return:cons@1
    :scope:end
    :scope
        :define:~0:static
        :define:~1:static
        :require:static
        :call:static@sub:^~0:1 :store:~0
        :call:&-1:~0 :store:~1
        :call:static@sum:^~0:~1 :store:~0
        :return:~0
    :scope:end
:define:end

There, static means int, &-1 refers to the function itself, ^~0 fetches the var in the scope above and @ is to divide the parameters.

How bad is this language?

Any idea on how to make it more "pretty" is welcome.


There was another question a while back, but I can't seem to find it right now...

So, this question is requesting that we review the code for ease of use, but it's not really asking for a review of the code, it's asking for a review of the design of the language. So, there are a few issues here as I see it.

  1. We don't know anything about the language in question. There is no link to any kind of documentation. How do we know if the code in question is good code if we don't have any standard to go by?
  2. We've asserted before that if there is no compiler, then it is hypothetical code.
  3. It clearly falls into the grey area of reviewing design.

So, is this question on topic? I've made a case against it here, but I'm still hesitant about casting a close vote on it.

Update: This question has since been closed as "Primarily Opinion Based". I'd be interested to hear from the voters what their reasoning was.

\$\endgroup\$
  • 1
    \$\begingroup\$ I found a discussion on Programmers meta related to this topic that may provide some useful information. \$\endgroup\$ – Phrancis Sep 25 '14 at 14:26
  • \$\begingroup\$ @Phrancis According to that, the question linked isn't a 'valid' question to the website? \$\endgroup\$ – Ismael Miguel Sep 25 '14 at 14:35
  • 2
    \$\begingroup\$ I thought at first it would be better fit for Programmers.SE, but apparently it's off-topic on their site unless you mention a specific problem, rather than "How is my design?" \$\endgroup\$ – Phrancis Sep 25 '14 at 15:02
12
\$\begingroup\$

We review real-world code and make suggestions for improvement.

We could review example code, but have decided not to: if code is not supposed to run, how can it get better at doing nothing? Furthermore, it's very hard to review code if we can't run it to test our suggestions. Therefore, pseudocode or code examples for a new programming language without any available compilers or interpreters do not supply the code necessary for a code review.

We could review designs, but have decided not to, simply as a matter of scope. Code reviews might still address the small-scale design of the code.

We can absolutely review language implementations.

We could review language designs, but it's simply off-topic, and prone to be very opinion-based. Your language doesn't have lambdas? -1. It has automatic semicolon insertion? +1. Whereas a code review can orient itself at industry best practices, PL design is pretty subjective, and a review can easily deteriorate into going through a feature checklist. In theory, a question such as “Given a context C, can my language L designed to solve problem P be improved?” could be constructive and objective. But that still falls short of actually containing code, and is therefore off topic here.

If phrased in a suitable manner – that means, not too broad and objectively answerable –, then requests for language design review can be asked on Programmers.SE.

As an aside: That question doesn't even contain a language design, just a couple of vague requirements and a syntax sample. In its current form, it is not suitable for any site in the Stack Exchange network.

\$\endgroup\$
4
\$\begingroup\$

The Question in Question is very Off-Topic for Code Review.

OP is not asking to review the code that is given, and the code that is given is not set in stone either, it is not static so it can change based on the answers received.

The question is more leaning to "How do I create a Language that will compile to X Language"

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .