-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.readme
More file actions
313 lines (249 loc) · 8.5 KB
/
.readme
File metadata and controls
313 lines (249 loc) · 8.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# supcode
<!--
will putting this here
confuse you
altho tbh the probability
that someone finds this
is astronomically low
-->
<div align="center">

A modern, high-level, feature-rich general-purpose programming language.
[site<sup>↗</sup>](https://sup2point0.github.io/supcode) \ [walkthrough](resources/supcoda/) \ [docs](docs/) \ [reddit<sup>↗</sup>](https://reddit.com/r/supcode) \ [Nova](resources/Nova)
</div>
---

<br>
## Features
- Intuitive keyword-focused syntax
- Object-oriented and dynamically typed
- `kebab-case` in identifiers for maximum readability
- Clean and easy modularisation and path resolution
- Flexible with configurations and flavours
- Versatile with extensions and frameworks
- Purely conceptual – you can’t write a single bug if the code doesn’t run!
## Explore
> [!TIP]
> For the best first viewing experience, check out the [supcode site<sup>↗</sup>](https://sup2point0.github.io/supcode)!
Want to see more of supcode? We’ve got a huge array of [specimens](specimens/).
Looking to learn the language? The [*supcoda*](resources/supcoda/) is a full walkthrough.
Instant question? There’s a good chance it’s answered in [FAQ](faq.md).

## Info
<table>
<tr>
<th colspan="2"> <h3> supcode 5.0 </h3> </th>
</tr>
<tr>
<td> official name </td>
<td> supcode </td>
</tr>
<tr>
<td> format </td>
<td> text-based </td>
</tr>
<tr>
<td> level </td>
<td> <a href="https://wikipedia.org/wiki/High-level_programming_language">high-level</a> </td>
</tr>
<tr>
<td> <a href="https://wikipedia.org/wiki/Execution_(computing)">execution</a> </td>
<td> <a href="https://wikipedia.org/wiki/Interpreter_(computing)">interpreted</a> </td>
</tr>
<tr>
<td> <a href="https://wikipedia.org/wiki/Programming_paradigm">paradigm</a> </td>
<td> <a href="https://wikipedia.org/wiki/Imperative_programming">imperative</a>, <a href="https://en.m.wikipedia.org/wiki/Object-oriented_programming">object-oriented</a>, <a href="https://wikipedia.org/wiki/Event-driven_programming">event-driven</a> </td>
</tr>
<tr>
<td> purpose </td>
<td> <a href="https://wikipedia.org/wiki/General-purpose_programming_language">general-purpose</a> </td>
</tr>
<tr>
<td> syntax </td>
<td> human-friendly – readable, intuitive, keyword-focused </td>
</tr>
<tr>
<td> <a href="https://wikipedia.org/wiki/Type_system">type</a> </td>
<td> <a href="https://wikipedia.org/wiki/Type_system#DYNAMIC">dynamic</a> </td>
</tr>
<tr>
<td> indentation </td>
<td> <a href="https://wikipedia.org/wiki/Off-side_rule">significant</a> (pre-6.0) <br> <a href="https://en.m.wikipedia.org/wiki/Free-form_language">insignificant</a> (post-6.0) </td>
</tr>
<tr>
<td> <a href="https://wikipedia.org/wiki/Operating_system">platform</a> </td>
<td> any </td>
</tr>
<tr>
<td> based on </td>
<td> <a href="https://scratch.mit.edu">Scratch</a>, <a href="https://python.org">Python</a> </td>
</tr>
<tr>
<td> inspired by </td>
<td> <a href="https://mediawiki.org/wiki/Wikitext">Wikitext Markup</a>, <a href="https://swift.org">Swift</a>, C#, HTML </td>
</tr>
<tr>
<td> <a href="https://wikipedia.org/wiki/Filename_extension">filename extensions</a> </td>
<td> <code>.sc</code>, <code>.sc6</code> <code>.sc5</code>, <code>.scx</code> </td>
</tr>
<tr>
<td> other extensions </td>
<td> <code>.scd</code>, <code>.scp</code>, <code>.scv</code>, <code>.scl</code>, <code>.scs</code>, <code>.scg</code> </td>
</tr>
<tr>
<td> main <a href="https://wikipedia.org/wiki/Flavors_(programming_language)">flavour</a> </td>
<td> <a href="source/syntax.md#utinax">Utinax One</a> </td>
</tr>
<tr>
<td> other flavours </td>
<td> <a href="source/syntax.md#veritinax">Veritinax One</a>, <a href="source/syntax.md#resinax">Resinax 1.6</a> </td>
</tr>
<tr>
<td> initial release </td>
<td> September 2021 </td>
</tr>
<tr>
<td> founder </td>
<td> <a href="https://github.com/Sup2point0">Sup#2.0</a> </td>
</tr>
<tr>
<td> developer </td>
<td> 2.0 Studios (2.0 Studios LLC) </td>
</tr>
<tr>
<td> <a href="https://wikipedia.org/wiki/Integrated_development_environment">IDEs</a> </td>
<td> <a href="suplus/supcode%20Studio">supcode Studio</a>, <a href="suplus/supcode%20Studio/supcode%20Studio%20Strium">supcode Studio Strium</a> </td>
</tr>
<tr>
<td> latest release </td>
<td> 5.7 (July 2023) <br> 6.0 (upcoming) </td>
</tr>
</table>
## Contributing
Feedback, thoughts and criticism are absolutely welcome! Just drop something in [issues]() or [discussions]().
## Roadmap
- [ ] site
- [ ] *supcoda*
- [x] *Learn supcode in Y minutes*
- [x] PrismJS syntax highlighter
## About
Made with love by Sup#2.0 ([@Sup2Point0]()).
On ? September 2021, I sent a code file written in a hypothetical programming language to my friend, just as a joke. What d’y’know, a joke develops until it becomes reality, and supcode was born. Development subsequently kicked off, with 3 major revisions of the language, before we reached stability with supcode 4.0.
supcode draws upon each and every coding language I’ve worked with – primarily Scratch, Python and Wikitext Markup. Its original intention was to act as a bridge between the block-based syntax of Scratch and text-based syntax of real code, although the language has ~~deteriorated~~ developed too far for this vision to remain accurate. Above all, it aims to be fun, unique and dynamic.
I’ve placed all this work under the MIT license, but in the unlikely case that anyone would like to use any of it, credit would be appreciated.
Enjoy!
<br>
## Specimens
### supcode 6.0
> [!Note]
> *supcode 6.0* is currently under development.
```coffee
<sup ver="6" sty="utinax-vis" ind=3>
\\
DISCLAIMER –
This code is only a peek at what supcode can do.
It is not by any means functional, optimised or perfect.
Enjoy ^v^
\\
<sec 'structs'>
create struct 'profile' {
\\
Represents a user profile.
\\
evolve action create self(ctx) [
| int 'id'
| str 'user', 'name'
| str, list(str) 'alts' = none
| list(str) 'langs' = list()
| list(str) 'apts' = list()
| (par)s 'pars'
] {
\\
Creates a new profile.
\\
auto set id, name, alt-name, langs, apts
set self.'render-keywords' = dict(
"id" = "User ID",
"name" = "Username",
"alts" = "Alternative Usernames",
"langs" = "Programming Languages",
"apts" = "Aptitudes",
)
loop for key, val in pars {
set self.(shard(key)) = val
}
}
create func self.render-text() to str {
set 'text' = "Profile[" + "\n"
loop for 'var' in self._vars_ {
if var in self.render-keywords {
alt text + "`render-keywords # var`: "
} else {
alt text + str(var) + ": "
}
alt text + { if var is iterable then {
str.join(
{ for each in var out str(each) }
) [sep = ", "]
} else str(var) }
}
out text
}
}
</sec>
<sec "core">
evolve sys.run(ctx) [(par)s]
{
set 'sup' = profile() [
| id = 2.0
| name = "Sup#2.0"
| alt-name = "Sup2point0"
| langs = "supcode", "Scratch", "Python", "C#", "HTML", "CSS", "JavaScript",
| apts = (
"creating", "designing", "coding", "procrastinating",
)
]
sys.out(sup.render-text())
sys.in()
sys.quit()
}
</sec>
\ how’d you like that?
</sup>
```
### supcode 5.7
```coffee
\ supcode 5.7
create struct 'SoupMachine' {
evolve func self.create(ctx) [
| num 'cost'
| str 'name' = none
| (str)s 'flavours' = ()
] {
set self.'cost' = cost
set self.'name' = { if name then name else ctx.shard.str }
set self.'flavours' = { loop for each in flavours || case(each)[lower] }
}
define self.purchase() [
| source
| int 'count' = 1
| pool[self.flavours] 'flavour' = none
] {
if count < 1 {
evoke "Can’t give that many bowls of soup!"
}
if not flavour {
set 'flavour' = random(self.flavours)[option]
}
alt source - self.cost * count
func.out("Here’s some flavour` soup!")
}
}
set 'credits' = 200
set 'soupy' = SoupMachine() [
| cost = 20
| flavours = "tomato", "mushroom", "potato"
]
sys.out(soupy.purchase(credits, 1, "mushroom"))
```
<!-- sup :v -->