You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ A Python to JavaScript / Ruby / C++ / Go / C# / PHP translator
7
7
8
8
[Pseudo](https://github.com/alehander42/pseudo) is a framework for high level code generation: it is used by this compiler to translate a subset of Python to all Pseudo-supported languages
9
9
10
-
## supported subset
10
+
## Supported subset
11
11
12
12
Pseudo supports a very clear and somehow limited subset of a language:
13
13
@@ -42,28 +42,28 @@ Pseudo supports a very clear and somehow limited subset of a language:
42
42
pseudo-python checks if your program is using a valid pseudo-translatable subset of Python, type checks it according to pseudo type rules and generates a `<filename>.pseudo.yaml` output file containing pseudo-ast code
43
43
44
44
[TODO]
45
-
you can directly run `pseudo-python <filename.py> <lang>` e.g.
45
+
You can directly run `pseudo-python <filename.py> <lang>` e.g.
46
46
47
47
```bash
48
48
pseudo-python <filename.py> ruby
49
49
pseudo-python <filename.py> cpp
50
50
```
51
51
etc for all the supported pseudo languages (javascript, c++, c#, go, ruby and python)
52
52
53
-
## error messages
53
+
## Error messages
54
54
55
-
a lot of work has been put into making pseudo-python error messages as clear and helpful as possible: they show the offending snippet of code and
55
+
A lot of work has been put into making pseudo-python error messages as clear and helpful as possible: they show the offending snippet of code and
56
56
often they offer suggestions, list possible fixes or right/wrong ways to write something
57
57
58
58

59
59
60
-
## type inference
60
+
## Type inference
61
61
62
-
the rules are relatively simple: currently pseudo-python infers everything
62
+
The rules are relatively simple: currently pseudo-python infers everything
63
63
from the usage of functions/classes, so you need to call/initialize all
64
64
of your functions/classes (except for no-arg functions)
65
65
66
-
often you don't really need to do that for **all** of them, you just need
66
+
Often you don't really need to do that for **all** of them, you just need
67
67
to do it in a way that can create call graphs covering all of them
68
68
(e.g. often you'll have `a` calling `b` calling `x` and you only need to
69
69
have an `a` invocation in your source)
@@ -92,13 +92,13 @@ Other pseudo-tips:
92
92
93
93
* Homogeneous tuples are converted to `pseudo` fixed length arrays and heterogeneous to `pseudo` tuples. in the future `pseudo-python` would analyze better `lists`/`tuple` usage to classify them better in `list`/`array`/`tuple` categories (which can optimize the resulting code in `go`/`c++`/`c#`)
94
94
95
-
*attributes that aren't called from other classes are translated as `private`, the other ones as `public`. The rule for methods is different:
95
+
*Attributes that aren't called from other classes are translated as `private`, the other ones as `public`. The rule for methods is different:
96
96
`_name` ones are only translated as `private`. That can be added as
97
97
config option in the future
98
98
99
-
*multiple returns values are supported, but they are converted to `array`/`tuple`
99
+
*Multiple returns values are supported, but they are converted to `array`/`tuple`
100
100
101
-
*single inheritance is supported, `pseudo-python` supports polymorphism
101
+
*Single inheritance is supported, `pseudo-python` supports polymorphism
102
102
but methods in children should accept the same types as their equivalents in the hierarchy (except `__init__`)
103
103
104
104
The easiest way to play with the type system is to just try several programs: `pseudo-python` errors should be enough to guide you, if not,
0 commit comments