Update: no one entered on time, but as I've seen at least one question on main site meeting the requirements, I'll be extending the entry date to the end of this week (23:59:59 UTC+0000 on 8 December 2017), provided you posted the question on the main site before the deadline of Thursday, 30 November 2017 at 23:59:59 UTC+0000.
The CODE REVIEW 2017 Challenge was selected last night, I've attached the details of the winning challenge below.
To enter the challenge, simply post your entry as an answer to this question. The challenge ends on Thursday, 30 November 2017 23:59:59 UTC+0000, all entries must be submitted by then.
To enter, you simply need to follow all the rules below.
- Complete all required portions of the selected challenge;
- Post the implementation of the challenge as a question on the main-site tagged community-challenge;
- Post an answer to this entry question;
- Include a link to the main site question in the answer to the entry form;
Write your own programming language
Since we're writing a language, it's always good to know that it works. And so to score each point that adds additional features requires a unit test. All unit test must be provided for you to score the point. To allow all languages to do this, you can verify the programs output in the language you're writing in. And so if you were to write your language in the Python programming language having a unit test such as the following would be valid:
import unittest
class TestStandardArithmetic(unittest.TestCase):
def test_addition(self):
# Replace `eval` with how you run your code
self.assertEqual(eval('1 + 1'), 2)
Requirements
You won't be scored for any use of
eval
that's provided by your language. Postinginput()
as your language, and requiring Python 2 is a valid language, however will score you no points.When scoring each point, you must use your own implementation for that point to score the point. This allows you to use, say, the LLVM to implement tail recursion in your language by default, however when scoring the point for tail recursion, you have to use your own implementation of it rather than the one provided to you by the LLVM.
Another person must be able to verify your language works. And so make it runnable from either Windows, Linux, Mac, or via a website.
If it needs another program to run, such as CPython, the JVM, or a browser, that is fine. But it must be runnable on one of the above systems, or via a website. You must detail the requirements if a non-standard system is required.
Since to do this we need to be able to get either a binary, or your code, entries need to produce a GitHub, or any other code sharing service, repository for their language. This allows entries to write Code Review questions on what they want reviewed, rather than a new question of their entire code on each change.
This repository must be provided in the entry meta question on your entry.
Scoring
Each bullet point is worth one point. 'Functions' may be prefix, infix or postfix operators, normal functions, or any other method that's usable in your language.
For each bullet point that adds an additional function or feature write a test case/suite with at least one unit test for each additional function or feature.
Implement all standard operators/functions. (1 point)
- addition (
+
) - subtraction (
-
) - multiplication (
*
) - division (
/
) - less than (
<
) - less than or equal (
<=
) - greater than (
>
) - greater than or equal (
>=
) - equal (
==
) - not equal (
!=
) - binary or (
|
) - binary xor (
^
) - binary and (
&
) - binary invert (
~
) - binary left shift (
<<
) - binary right shift (
>>
) - boolean and (
&&
) - boolean or (
||
)
- addition (
- Implement operator precedence. Perform, say, multiplication and division before addition and subtraction. (1 point)
- Use lexical analysis to generate a token stream. (1 point)
- Use syntactic analysis to generate an AST, or related structure. (1 point)
- Have your language be directly interpreted. (1 point)
- Have your language compile to an intermediate language. (1 point)
- Have your language compile to an intermediate language and then be executed by a 'virtual machine'. Your intermediate language must be custom-made in order to gain this point. (1 point)
- Have your language compile directly to assembly. (1 point)
- Write a Code Review question in your language. (1 point)
Total: 9 points
In addition to the above you may also get points for implementing programming paradigms, according to Scoring of paradigm support. A big thanks to CAD97 for making such a large list, anyone can add to.
(+ 1 2 (- 3 4 5 6))
. Will they automatically get or lose a point? \$\endgroup\$