Skip to content

Commit 4e16c28

Browse files
committed
Ritchie becomes Rix
1 parent bee5f6c commit 4e16c28

29 files changed

+305
-2394
lines changed

.cproject

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
</cconfiguration>
4545
</storageModule>
4646
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
47-
<project id="ritchie.null.1537535432" name="ritchie"/>
47+
<project id="rix.null.1537535432" name="rix"/>
4848
</storageModule>
4949
<storageModule moduleId="scannerConfiguration">
5050
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,14 @@
2626
*~
2727
*.tab.c
2828
*.tab.h
29+
rixc
2930
ritc
31+
rix_temp_file.rit
32+
*.output
3033

3134
out.c
3235
out.h
36+
out.sh
3337

3438
# Misc
3539
*.swp

.project

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<projectDescription>
3-
<name>ritchie</name>
3+
<name>rix</name>
44
<comment></comment>
55
<projects>
66
</projects>

LICENCE.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The source code is distributed under the GNU General Public License version 3, with the addition under section 7 of an exception described in the “Ritchie Runtime Library Exception, version 3.1” (Please see Ritchie RUNTIME LIBRARY EXCEPTION)
1+
The source code is distributed under the GNU General Public License version 3, with the addition under section 7 of an exception described in the “Rix Runtime Library Exception, version 3.1” (Please see Rix RUNTIME LIBRARY EXCEPTION)
22

33

44
GNU GENERAL PUBLIC LICENSE
@@ -682,7 +682,7 @@ The Runtime is licensed under the MIT License. The "language" consists of the co
682682

683683
Copyright (c) 2015: Riolet Corporation and other contributors:
684684

685-
https://github.com/riolet/ritchie/graphs/contributors
685+
https://github.com/riolet/rix/graphs/contributors
686686

687687
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
688688

@@ -691,7 +691,7 @@ The above copyright notice and this permission notice shall be included in all c
691691
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
692692

693693

694-
Ritchie RUNTIME LIBRARY EXCEPTION
694+
Rix RUNTIME LIBRARY EXCEPTION
695695
=================================
696696

697697
Version 3.1, 31 March 2009
@@ -701,14 +701,14 @@ Copyright (C) 2009 Free Software Foundation, Inc.
701701
Everyone is permitted to copy and distribute verbatim copies of this
702702
license document, but changing it is not allowed.
703703

704-
This Ritchie Runtime Library Exception ("Exception") is an additional
704+
This Rix Runtime Library Exception ("Exception") is an additional
705705
permission under section 7 of the GNU General Public License, version
706706
3 ("GPLv3"). It applies to a given file (the "Runtime Library") that
707707
bears a notice placed by the copyright holder of the file stating that
708708
the file is governed by GPLv3 along with this Exception.
709709

710-
When you use Ritchie to compile a program, Ritchie may combine portions of
711-
certain Ritchie header files and runtime libraries with the compiled
710+
When you use Rix to compile a program, Rix may combine portions of
711+
certain Rix header files and runtime libraries with the compiled
712712
program. The purpose of this Exception is to allow compilation of
713713
non-GPL (including proprietary) programs to use, in this way, the
714714
header files and runtime libraries covered by this Exception.
@@ -720,14 +720,14 @@ Library for execution after a Compilation Process, or makes use of an
720720
interface provided by the Runtime Library, but is not otherwise based
721721
on the Runtime Library.
722722

723-
"Ritchie" means a version of the Ritchie Language, with or without
723+
"Rix" means a version of the Rix Language, with or without
724724
modifications, governed by version 3 (or a specified later version) of
725725
the GNU General Public License (GPL) with the option of using any
726726
subsequent versions published by the FSF.
727727

728728
"GPL-compatible Software" is software whose conditions of propagation,
729-
modification and use would permit combination with Ritchie in accord with
730-
the license of Ritchie.
729+
modification and use would permit combination with Rix in accord with
730+
the license of Rix.
731731

732732
"Target Code" refers to output from any compiler for a real or virtual
733733
target processor architecture, in executable form or suitable for
@@ -744,10 +744,10 @@ part of the Compilation Process, since the Compilation Process can be
744744
understood as starting with the output of the generators or
745745
preprocessors.
746746

747-
A Compilation Process is "Eligible" if it is done using Ritchie, alone or
747+
A Compilation Process is "Eligible" if it is done using Rix, alone or
748748
with other GPL-compatible software, or if it is done without using any
749-
work based on Ritchie. For example, using non-GPL-compatible Software to
750-
optimize any Ritchie intermediate representations would not qualify as an
749+
work based on Rix. For example, using non-GPL-compatible Software to
750+
optimize any Rix intermediate representations would not qualify as an
751751
Eligible Compilation Process.
752752

753753
1. Grant of Additional Permission.
@@ -759,11 +759,11 @@ all Target Code was generated by Eligible Compilation Processes. You
759759
may then convey such a combination under terms of your choice,
760760
consistent with the licensing of the Independent Modules.
761761

762-
2. No Weakening of Ritchie Copyleft.
762+
2. No Weakening of Rix Copyleft.
763763

764764
The availability of this Exception does not imply any general
765765
presumption that third-party software is unaffected by the copyleft
766-
requirements of the license of Ritchie.
766+
requirements of the license of Rix.
767767

768768

769769
Hopefully that text is self-explanatory. If it isn't, you need to speak to your lawyer, or the Free Software Foundation.

Makefile

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
all: ritc
1+
all: rixc
22

3-
ritchie.tab.c ritchie.tab.h: ritchie.y
4-
bison -d ritchie.y
3+
rix.tab.c rix.tab.h: rix.y
4+
bison -d rix.y
55

6-
lex.yy.c: ritchie.l ritchie.tab.h
7-
flex ritchie.l
6+
lex.yy.c: rix.l rix.tab.h
7+
flex rix.l
88

9-
ritc: lex.yy.c ritchie.tab.c ritchie.tab.h
10-
gcc -ggdb preproc.c ObjectTree.c ritchie.tab.c lex.yy.c ritc.c errors.c crsl.c -lfl -o ritc
9+
rixc: lex.yy.c rix.tab.c rix.tab.h
10+
gcc -ggdb preproc.c ObjectTree.c rix.tab.c lex.yy.c rixc.c errors.c crsl.c -lfl -o rixc
1111

1212
clean:
13-
rm ritc ritchie.tab.c lex.yy.c ritchie.tab.h
13+
rm rixc rix.tab.c lex.yy.c rix.tab.h

README.md

+28-23
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,67 @@
1-
Ritchie Language
1+
Rix Language
22
================
33

4-
Ritchie is an expressive and efficient language for the C ecosystem. Ritchie uses C libraries natively and generates easy to understand C code. It is named after the great computer scientist Dennis Ritchie, if not for whom we would all be programming in Visual Basic.
4+
Rix is an expressive and efficient language for the C ecosystem. Rix uses C libraries natively and generates easy to understand C code.
55

6-
There are five core principles behind Ritchie:
6+
There are five core principles behind Rix:
77

88
1. Ease of programming, inspired by Python
99
2. Fast, like C code
1010
3. Type safety, like Scala
1111
4. Ability to go lower level and write C code
1212
5. No reserved keywords, everything is redefinable
1313

14-
We ran the [prime counting benchmark](https://bjpelc.wordpress.com/2015/01/10/yet-another-language-speed-test-counting-primes-c-c-java-javascript-php-python-and-ruby-2/) for Ritchie, C and Python. Here's what we got:
14+
We ran the [prime counting benchmark](https://bjpelc.wordpress.com/2015/01/10/yet-another-language-speed-test-counting-primes-c-c-java-javascript-php-python-and-ruby-2/) for Rix, C and Python. Here's what we got:
1515

16-
| | Ritchie | C | Python |
16+
| Measure | Rix | C | Python |
1717
|--------------------|---------|-----|--------|
1818
| Runtime (ms) | 457 | 424 | 7836 |
19-
| Characters of code | 423 | 542 | 474 |
19+
| Characters of code | 413 | 542 | 474 |
2020

21-
The best way to introduce yourself to this language is to take a look at some of the examples and try running them. Ritchie is still in early development; many features have not yet been fully implemented or described. A list of major [development tasks remaining](https://github.com/riolet/ritchie/wiki/State-of-the-Compiler) can be found in the wiki.
21+
The best way to introduce yourself to this language is to take a look at some of the examples and try running them. Rix is still in early development; many features have not yet been fully implemented or described. A list of major [development tasks remaining](https://github.com/riolet/rix/wiki/State-of-the-Compiler) can be found in the wiki.
2222

2323
Features
2424
========
2525

26-
* Ritchie uses category inferencing, so the boilerplate Java statement:
26+
* Rix uses type inferencing, so the boilerplate Java statement:
2727

2828
```
2929
Point point = new Point (x,y)
3030
```
3131

32-
becomes a short Ritchie statement:
32+
becomes a short Rix statement:
3333

3434
```
3535
#point = Point (x, y)
3636
```
37-
Identifiers have their category inferred if they are marked as new with "#". Their types cannot be changed once set. In the above example, `point` gets category `Point`.
3837

38+
New identifiers have are marked as new with "#", and Rix will infer their type for you. Their types cannot be changed once set. In the above example, `point` gets category `Point`.
3939

40-
* Ritchie tries to follow English linguistic constructs, so, most of Ritchie language expressions take the form:
40+
* Rix provides exception-safe resource management using Resource Acquisition Is Initialization (RAII), so you don't have to worry about memory leaks and unclosed file handles.
41+
42+
43+
* Rix tries to follow English linguistic constructs wherever possible and practical, so, most of Rix language expressions take the form:
4144

4245
Subject Verb Object
4346

4447
The following phrase:
4548

4649
```
4750
hello = "Hello"
51+
helloWorld.add(hello)
4852
```
49-
parses as:
53+
parse as:
5054

5155

5256
| Subject | Verb | Object |
5357
|---------|------|---------|
5458
| hello | = | "Hello" |
59+
| myset | add | hello |
5560

5661

57-
* Ritchie has no keywords. All operators in Ritchie can be overloaded.
58-
62+
Subjects and objects are collectively known as nouns, and are analogous to object (instances of a class) in object-oriented programming.
5963

60-
* We call verbs the constructs called functions, methods or subroutines in other languages. For example:
64+
Methods and function are called *verbs* in ritchie. For example:
6165

6266
```
6367
factorial -> int (int n)
@@ -77,26 +81,27 @@ fib -> int(int n) = (n <= 1).tf (n, fib(n-1) + fib(n-2))
7781
print (fib(5))
7882
```
7983

80-
There's no assignment operator in Ritchie, but `=` is defined as an assignment verb for `Identifier`.
84+
There's no assignment operator in Rix, but `=` is defined as an assignment verb for `Identifier`.
8185

8286
* A special category of verb is a control flow verb.
8387

84-
`if`, `while` and `for` in Ritchie are all such verbs. They are not keywords, as you can redefine them, although this is probably not a good idea.
88+
`if`, `while` and `for` in Rix are all such verbs. They are not keywords, as you can redefine them, although this is probably not a good idea.
89+
* Rix has no keywords. All operators in Rix can be overloaded.
8590

86-
* Ritchie is whitespace sensitive
8791

92+
* Rix is whitespace sensitive
8893

8994

9095
Get started
9196
===========
92-
1. Build the ritchie compiler `make clean;make`
93-
2. Write your ritchie program in your favourite text editor (let's call it program.rit)
94-
3. Set RITCHIE_HOME `export RITCHIE_HOME=/path/to/ritchie`
95-
4. Run `${RITCHIE_HOME}/ritchie.sh program.rit` and ritchie will build, execute and run the program
97+
1. Build the rix compiler `make clean;make`
98+
2. Write your rix program in your favourite text editor (let's call it program.rit)
99+
3. Set RIX_HOME `export RIX_HOME=/path/to/rix`
100+
4. Run `${RIX_HOME}/rix.sh program.rit` and rix will build, execute and run the program
96101

97102
Team
98103
====
99-
Ritchie Language is being developed by a group of efficiency obsessed programmers for demanding programmers who want both the conciseness of Python and the efficiency of C.
104+
Rix Language is being developed by a group of efficiency obsessed programmers for demanding programmers who want both the conciseness of Python and the efficiency of C.
100105

101106
Concept: [Rohana Rezel](https://github.com/rrezel) ([Riolet Corporation](https://github.com/riolet))
102107

benchmarks/benchmark.rit

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
isPrime -> bool(int n)
2-
if (n < 2)
3-
-> false
4-
if (n == 2)
5-
-> true
1+
isPrimeThreeOrMore -> bool (int n)
62
if (n % 2 == 0)
73
-> false
84

@@ -13,6 +9,7 @@ isPrime -> bool(int n)
139

1410
-> true
1511

12+
isPrime -> bool(int n) = (n<>2).leg (false, true, isPrimeThreeOrMore(n))
1613

1714
#lim = 2000000
1815
#numPrimes = 0

clr.sh

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

2-
if [ -f ritc ]
2+
if [ -f rixc ]
33
then
4-
echo Clearing: ritc -- preventing unexpected test results
5-
rm ritc
4+
echo Clearing: rixc -- preventing unexpected test results
5+
rm rixc
66
fi
77

88
if [ -f lex.yy.c ]
@@ -11,16 +11,16 @@ if [ -f lex.yy.c ]
1111
rm lex.yy.c
1212
fi
1313

14-
if [ -f ritchie.tab.c ]
14+
if [ -f rix.tab.c ]
1515
then
16-
echo Clearing: ritchie.tab.c -- bison output
17-
rm ritchie.tab.c
16+
echo Clearing: rix.tab.c -- bison output
17+
rm rix.tab.c
1818
fi
1919

20-
if [ -f ritchie.tab.h ]
20+
if [ -f rix.tab.h ]
2121
then
22-
echo Clearing: ritchie.tab.h -- bison output
23-
rm ritchie.tab.h
22+
echo Clearing: rix.tab.h -- bison output
23+
rm rix.tab.h
2424
fi
2525

2626
if [ -f out.c ]

comp.sh

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
if [ -f ritchie.y ]
1+
if [ -f rix.y ]
22
then
3-
echo Compiling: ritchie.y
4-
bison -d ritchie.y
3+
echo Compiling: rix.y
4+
bison -d rix.y
55
else
6-
echo ritchie.y not found
6+
echo rix.y not found
77
fi
88

9-
if [ -f ritchie.l ]
9+
if [ -f rix.l ]
1010
then
11-
echo Compiling: ritchie.l
12-
flex ritchie.l
11+
echo Compiling: rix.l
12+
flex rix.l
1313
else
14-
echo ritchie.l not found
14+
echo rix.l not found
1515
fi

crsl.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
/* These should be written in pure Ritchie */
1+
/* These should be written in pure Rix */
22

33
#include "ObjectTree.h"
44
#include "crsl.h"
5-
#include "ritc.h"
5+
#include "rixc.h"
66

77
void defineRSLSymbols(Object * root)
88
{

0 commit comments

Comments
 (0)