solpl 2.3.7__tar.gz → 2.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- solpl-2.4.1/PKG-INFO +91 -0
- solpl-2.4.1/README.md +78 -0
- {solpl-2.3.7 → solpl-2.4.1}/interpreter/sol.py +12 -11
- solpl-2.4.1/pyproject.toml +25 -0
- solpl-2.4.1/solpl.egg-info/PKG-INFO +91 -0
- solpl-2.4.1/solpl.egg-info/entry_points.txt +2 -0
- solpl-2.3.7/PKG-INFO +0 -7
- solpl-2.3.7/README.md +0 -45
- solpl-2.3.7/pyproject.toml +0 -15
- solpl-2.3.7/solpl.egg-info/PKG-INFO +0 -7
- solpl-2.3.7/solpl.egg-info/entry_points.txt +0 -2
- {solpl-2.3.7 → solpl-2.4.1}/LICENSE +0 -0
- {solpl-2.3.7 → solpl-2.4.1}/setup.cfg +0 -0
- {solpl-2.3.7 → solpl-2.4.1}/solpl.egg-info/SOURCES.txt +0 -0
- {solpl-2.3.7 → solpl-2.4.1}/solpl.egg-info/dependency_links.txt +0 -0
- {solpl-2.3.7 → solpl-2.4.1}/solpl.egg-info/top_level.txt +0 -0
solpl-2.4.1/PKG-INFO
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: solpl
|
|
3
|
+
Version: 2.4.1
|
|
4
|
+
Summary: A lightweight, multi-threaded interpreter for the Sol programming language
|
|
5
|
+
Author-email: stefand-0 <stefand-0@users.noreply.github.com>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Requires-Python: >=3.7
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Dynamic: license-file
|
|
13
|
+
|
|
14
|
+
# Sol
|
|
15
|
+
|
|
16
|
+

|
|
17
|
+

|
|
18
|
+

|
|
19
|
+

|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
Sol is an interpreted language with minimal functional paradigms built with Python, originally designed to handle async operations only, but has expanded to a full scripting language.
|
|
23
|
+
|
|
24
|
+
# Why did I build Sol?
|
|
25
|
+
|
|
26
|
+
I originaly needed something fast, that handled async natively, and which had very few keywords. Then came my first prototype, which only supported async functions. Sol now supports everything a programming language should need: Functions, variables, I/O, etc.
|
|
27
|
+
|
|
28
|
+
# What advantages does Sol have over other languages?
|
|
29
|
+
|
|
30
|
+
- Native async, with no external libraries
|
|
31
|
+
|
|
32
|
+
- Native networking, also with no external libraries
|
|
33
|
+
|
|
34
|
+
- With very few keywords, it is the language with the least keywords
|
|
35
|
+
|
|
36
|
+
- Easy to use standard libraries
|
|
37
|
+
|
|
38
|
+
- Simple syntax, which goes a long way for automation, web scraping, scripting, math, etc.
|
|
39
|
+
|
|
40
|
+
# Capabilities:
|
|
41
|
+
|
|
42
|
+
- Native asynchronous functions
|
|
43
|
+
|
|
44
|
+
- Native non-blocking IO
|
|
45
|
+
|
|
46
|
+
- Native networking library
|
|
47
|
+
|
|
48
|
+
- Support for structs
|
|
49
|
+
|
|
50
|
+
- Some functional paradigms, bound by the pipe operator ">>", used for channeling async, async into I/O, etc.
|
|
51
|
+
|
|
52
|
+
- A large collection of standard libraries (including standard web libraries)
|
|
53
|
+
|
|
54
|
+
# How to install Sol?
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip install solpl
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
# How to run a Sol script?
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
solpl FILENAME.sol
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
# Example:
|
|
67
|
+
|
|
68
|
+
This demonstrates Sol's capabilities with async:
|
|
69
|
+
|
|
70
|
+
```lua
|
|
71
|
+
countDown(taskName, maxCount)
|
|
72
|
+
for i -> 1 to maxCount
|
|
73
|
+
_out -> taskName
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
main()
|
|
78
|
+
_out -> 111
|
|
79
|
+
countDown(777, 4) >> _async
|
|
80
|
+
countDown(999, 4) >> _async
|
|
81
|
+
_out -> 222
|
|
82
|
+
end
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
# License
|
|
86
|
+
|
|
87
|
+
This repository is licensed with Apache License 2.0, see the LICENSE file for more details
|
|
88
|
+
|
|
89
|
+
# Link to PyPi package:
|
|
90
|
+
|
|
91
|
+
https://pypi.org/project/solpl/
|
solpl-2.4.1/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Sol
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+

|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
Sol is an interpreted language with minimal functional paradigms built with Python, originally designed to handle async operations only, but has expanded to a full scripting language.
|
|
10
|
+
|
|
11
|
+
# Why did I build Sol?
|
|
12
|
+
|
|
13
|
+
I originaly needed something fast, that handled async natively, and which had very few keywords. Then came my first prototype, which only supported async functions. Sol now supports everything a programming language should need: Functions, variables, I/O, etc.
|
|
14
|
+
|
|
15
|
+
# What advantages does Sol have over other languages?
|
|
16
|
+
|
|
17
|
+
- Native async, with no external libraries
|
|
18
|
+
|
|
19
|
+
- Native networking, also with no external libraries
|
|
20
|
+
|
|
21
|
+
- With very few keywords, it is the language with the least keywords
|
|
22
|
+
|
|
23
|
+
- Easy to use standard libraries
|
|
24
|
+
|
|
25
|
+
- Simple syntax, which goes a long way for automation, web scraping, scripting, math, etc.
|
|
26
|
+
|
|
27
|
+
# Capabilities:
|
|
28
|
+
|
|
29
|
+
- Native asynchronous functions
|
|
30
|
+
|
|
31
|
+
- Native non-blocking IO
|
|
32
|
+
|
|
33
|
+
- Native networking library
|
|
34
|
+
|
|
35
|
+
- Support for structs
|
|
36
|
+
|
|
37
|
+
- Some functional paradigms, bound by the pipe operator ">>", used for channeling async, async into I/O, etc.
|
|
38
|
+
|
|
39
|
+
- A large collection of standard libraries (including standard web libraries)
|
|
40
|
+
|
|
41
|
+
# How to install Sol?
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install solpl
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
# How to run a Sol script?
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
solpl FILENAME.sol
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
# Example:
|
|
54
|
+
|
|
55
|
+
This demonstrates Sol's capabilities with async:
|
|
56
|
+
|
|
57
|
+
```lua
|
|
58
|
+
countDown(taskName, maxCount)
|
|
59
|
+
for i -> 1 to maxCount
|
|
60
|
+
_out -> taskName
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
main()
|
|
65
|
+
_out -> 111
|
|
66
|
+
countDown(777, 4) >> _async
|
|
67
|
+
countDown(999, 4) >> _async
|
|
68
|
+
_out -> 222
|
|
69
|
+
end
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
# License
|
|
73
|
+
|
|
74
|
+
This repository is licensed with Apache License 2.0, see the LICENSE file for more details
|
|
75
|
+
|
|
76
|
+
# Link to PyPi package:
|
|
77
|
+
|
|
78
|
+
https://pypi.org/project/solpl/
|
|
@@ -32,7 +32,7 @@ class SolInterpreter:
|
|
|
32
32
|
|
|
33
33
|
with open(filename, "r") as f:
|
|
34
34
|
code = f.read()
|
|
35
|
-
base_name =
|
|
35
|
+
base_name = file.path.basename(filename)[0]
|
|
36
36
|
module_name = base_name.replace(".sol", "")
|
|
37
37
|
lines = [l.strip() for l in code.split('\n') if l.strip()]
|
|
38
38
|
for pc, line in enumerate(lines):
|
|
@@ -44,9 +44,9 @@ class SolInterpreter:
|
|
|
44
44
|
self.functions[f"{module_name}.{name}"] = {"start_pc": pc + 1, "params": params, "source_lines": lines}
|
|
45
45
|
|
|
46
46
|
def _compute(self, expr):
|
|
47
|
-
expr = str(expr).strip()
|
|
48
47
|
is_literal = (expr.startswith('"') and expr.endswith('"')) or (expr.startswith("'") and expr.endswith("'"))
|
|
49
|
-
|
|
48
|
+
expr = str(expr).strip()
|
|
49
|
+
if "+" in expr and not is_literally and any(c.isalpha() or c in ['"', "'"] for c in expr):
|
|
50
50
|
parts = expr.split("+")
|
|
51
51
|
result = ""
|
|
52
52
|
for p in parts:
|
|
@@ -106,7 +106,9 @@ class SolInterpreter:
|
|
|
106
106
|
existing_val = self._lookup(val)
|
|
107
107
|
if existing_val is not None: return existing_val
|
|
108
108
|
try: return float(val) if '.' in val else int(val)
|
|
109
|
-
except:
|
|
109
|
+
except:
|
|
110
|
+
print(f"Error: Failed to solve expression: {val}")
|
|
111
|
+
return None
|
|
110
112
|
|
|
111
113
|
def _async_worker(self, expr, action):
|
|
112
114
|
result = self._compute(expr)
|
|
@@ -146,21 +148,18 @@ class SolInterpreter:
|
|
|
146
148
|
self.threads.append(t)
|
|
147
149
|
|
|
148
150
|
def _evaluate_condition(self, cond):
|
|
149
|
-
def get_val(expr):
|
|
150
|
-
val = self._compute(expr.strip())
|
|
151
|
-
return val if val is not None else 0
|
|
152
151
|
if "==" in cond:
|
|
153
152
|
left, right = cond.split("==", 1)
|
|
154
|
-
return
|
|
153
|
+
return self._compute(left.strip()) == self._compute(right.strip())
|
|
155
154
|
if "=" in cond:
|
|
156
155
|
left, right = cond.split("=")
|
|
157
|
-
return
|
|
156
|
+
return self._compute(left.strip()) == self._compute(right.strip())
|
|
158
157
|
elif "<" in cond:
|
|
159
158
|
left, right = cond.split("<")
|
|
160
|
-
return
|
|
159
|
+
return self._compute(left.strip()) < self._compute(right.strip())
|
|
161
160
|
elif ">" in cond:
|
|
162
161
|
left, right = cond.split(">")
|
|
163
|
-
return
|
|
162
|
+
return self._compute(left.strip()) > self._compute(right.strip())
|
|
164
163
|
return False
|
|
165
164
|
|
|
166
165
|
def _get_block_end(self, start_pc):
|
|
@@ -348,3 +347,5 @@ def main():
|
|
|
348
347
|
|
|
349
348
|
if __name__ == "__main__":
|
|
350
349
|
main()
|
|
350
|
+
|
|
351
|
+
# do you really think I would go back and comment the code? i wrote the first version in a month.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "solpl"
|
|
7
|
+
version = "2.4.1"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name = "stefand-0", email = "stefand-0@users.noreply.github.com" }
|
|
10
|
+
]
|
|
11
|
+
description = "A lightweight, multi-threaded interpreter for the Sol programming language"
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
license = "Apache-2.0"
|
|
14
|
+
requires-python = ">=3.7"
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Operating System :: OS Independent"
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[project.scripts]
|
|
21
|
+
sol = "interpreter.sol:main"
|
|
22
|
+
|
|
23
|
+
[tool.setuptools.packages]
|
|
24
|
+
find = { include = ["interpreter"] }
|
|
25
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: solpl
|
|
3
|
+
Version: 2.4.1
|
|
4
|
+
Summary: A lightweight, multi-threaded interpreter for the Sol programming language
|
|
5
|
+
Author-email: stefand-0 <stefand-0@users.noreply.github.com>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Requires-Python: >=3.7
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Dynamic: license-file
|
|
13
|
+
|
|
14
|
+
# Sol
|
|
15
|
+
|
|
16
|
+

|
|
17
|
+

|
|
18
|
+

|
|
19
|
+

|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
Sol is an interpreted language with minimal functional paradigms built with Python, originally designed to handle async operations only, but has expanded to a full scripting language.
|
|
23
|
+
|
|
24
|
+
# Why did I build Sol?
|
|
25
|
+
|
|
26
|
+
I originaly needed something fast, that handled async natively, and which had very few keywords. Then came my first prototype, which only supported async functions. Sol now supports everything a programming language should need: Functions, variables, I/O, etc.
|
|
27
|
+
|
|
28
|
+
# What advantages does Sol have over other languages?
|
|
29
|
+
|
|
30
|
+
- Native async, with no external libraries
|
|
31
|
+
|
|
32
|
+
- Native networking, also with no external libraries
|
|
33
|
+
|
|
34
|
+
- With very few keywords, it is the language with the least keywords
|
|
35
|
+
|
|
36
|
+
- Easy to use standard libraries
|
|
37
|
+
|
|
38
|
+
- Simple syntax, which goes a long way for automation, web scraping, scripting, math, etc.
|
|
39
|
+
|
|
40
|
+
# Capabilities:
|
|
41
|
+
|
|
42
|
+
- Native asynchronous functions
|
|
43
|
+
|
|
44
|
+
- Native non-blocking IO
|
|
45
|
+
|
|
46
|
+
- Native networking library
|
|
47
|
+
|
|
48
|
+
- Support for structs
|
|
49
|
+
|
|
50
|
+
- Some functional paradigms, bound by the pipe operator ">>", used for channeling async, async into I/O, etc.
|
|
51
|
+
|
|
52
|
+
- A large collection of standard libraries (including standard web libraries)
|
|
53
|
+
|
|
54
|
+
# How to install Sol?
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip install solpl
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
# How to run a Sol script?
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
solpl FILENAME.sol
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
# Example:
|
|
67
|
+
|
|
68
|
+
This demonstrates Sol's capabilities with async:
|
|
69
|
+
|
|
70
|
+
```lua
|
|
71
|
+
countDown(taskName, maxCount)
|
|
72
|
+
for i -> 1 to maxCount
|
|
73
|
+
_out -> taskName
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
main()
|
|
78
|
+
_out -> 111
|
|
79
|
+
countDown(777, 4) >> _async
|
|
80
|
+
countDown(999, 4) >> _async
|
|
81
|
+
_out -> 222
|
|
82
|
+
end
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
# License
|
|
86
|
+
|
|
87
|
+
This repository is licensed with Apache License 2.0, see the LICENSE file for more details
|
|
88
|
+
|
|
89
|
+
# Link to PyPi package:
|
|
90
|
+
|
|
91
|
+
https://pypi.org/project/solpl/
|
solpl-2.3.7/PKG-INFO
DELETED
solpl-2.3.7/README.md
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# Sol
|
|
2
|
-
Sol is an interpreted language built with Python, originally designed to handle async operations only, but has expanded to a full scripting language.
|
|
3
|
-
|
|
4
|
-
# Why did I build Sol?
|
|
5
|
-
|
|
6
|
-
I needed something fast, that handled async natively, and which had very few keywords. Then came my first prototype, which only supported async functions. Sol now supports everything a programming language should need: Functions, variables, I/O, etc.
|
|
7
|
-
|
|
8
|
-
# How to install Sol?
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
pip install solpl
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
# How to run a Sol script?
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
solpl FILENAME.sol
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
# Example:
|
|
21
|
-
|
|
22
|
-
This demonstrates Sol's capabilities with async:
|
|
23
|
-
|
|
24
|
-
```lua
|
|
25
|
-
countDown(taskName, maxCount)
|
|
26
|
-
for i -> 1 to maxCount
|
|
27
|
-
_out -> taskName
|
|
28
|
-
end
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
main()
|
|
32
|
-
_out -> 111
|
|
33
|
-
countDown(777, 4) >> _async
|
|
34
|
-
countDown(999, 4) >> _async
|
|
35
|
-
_out -> 222
|
|
36
|
-
end
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
# License
|
|
40
|
-
|
|
41
|
-
This repository is licensed with Apache License 2.0, see the LICENSE file for more details
|
|
42
|
-
|
|
43
|
-
# Link to PyPi package:
|
|
44
|
-
|
|
45
|
-
https://pypi.org/project/solpl/
|
solpl-2.3.7/pyproject.toml
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
[build-system]
|
|
2
|
-
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
-
build-backend = "setuptools.build_meta"
|
|
4
|
-
|
|
5
|
-
[project]
|
|
6
|
-
name = "solpl"
|
|
7
|
-
version = "2.3.7"
|
|
8
|
-
description = "Sol Programming Language Interpreter"
|
|
9
|
-
requires-python = ">=3.7"
|
|
10
|
-
|
|
11
|
-
[project.scripts]
|
|
12
|
-
solpl = "interpreter.sol:main"
|
|
13
|
-
|
|
14
|
-
[tool.setuptools]
|
|
15
|
-
packages = ["interpreter"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|