Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code cleanup #70

Merged
merged 205 commits into from
Feb 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
205 commits
Select commit Hold shift + click to select a range
c38e1b9
build update
drkameleon Feb 3, 2021
9e3019b
removed obsolete bytecodes
drkameleon Feb 3, 2021
6dcead9
Remove unnecessary comments + Better headers + renamed `requireArgs` …
drkameleon Feb 3, 2021
f9a5341
`require` implementation was obsolete and renamed/moved to Globals
drkameleon Feb 3, 2021
6809897
`requireArgs` became `require`
drkameleon Feb 3, 2021
da14139
build update
drkameleon Feb 3, 2021
c800908
build update
drkameleon Feb 3, 2021
3dc6f92
build update
drkameleon Feb 3, 2021
9a378f6
build update
drkameleon Feb 3, 2021
a8ba90e
build update
drkameleon Feb 3, 2021
c2d3484
build update
drkameleon Feb 3, 2021
911ef3c
build update
drkameleon Feb 3, 2021
ce129cf
build update
drkameleon Feb 3, 2021
fe7830b
build update
drkameleon Feb 3, 2021
c53f8c6
added custom errors: RuntimeError_NotEnoughArguments & RuntimeError_W…
drkameleon Feb 3, 2021
cd33935
build update
drkameleon Feb 3, 2021
0fabc32
added `--skipProjCfg:on` for non-Windows builds
drkameleon Feb 3, 2021
9930e65
build update
drkameleon Feb 3, 2021
74bd102
build update
drkameleon Feb 3, 2021
54ee31c
removed unused imports
drkameleon Feb 3, 2021
83502ce
commented outs unused templates
drkameleon Feb 3, 2021
f168656
build update
drkameleon Feb 3, 2021
82ebfd6
build update
drkameleon Feb 3, 2021
007e784
changed `--skipProjCfg:on` to `--skipParentCfg:on`
drkameleon Feb 3, 2021
7ea8181
cleaned up imports
drkameleon Feb 3, 2021
87beb20
removed redundant comments
drkameleon Feb 3, 2021
7850f33
code cleanup
drkameleon Feb 3, 2021
4cdd3ad
fixed comments + removed redundant functions (`printOne`)
drkameleon Feb 3, 2021
0e90d3d
re-organized Stack-related variables + code cleanup
drkameleon Feb 3, 2021
e82d132
build update
drkameleon Feb 3, 2021
404e2ad
build update
drkameleon Feb 3, 2021
d4449ae
build update
drkameleon Feb 3, 2021
6c98420
build update
drkameleon Feb 3, 2021
551809a
build update
drkameleon Feb 3, 2021
78b2bfb
build update
drkameleon Feb 3, 2021
1d88241
build update
drkameleon Feb 3, 2021
f10f1d7
build update
drkameleon Feb 3, 2021
31c0978
build update
drkameleon Feb 3, 2021
69aa1d8
build update
drkameleon Feb 3, 2021
5981f8f
build update
drkameleon Feb 3, 2021
31676f9
build update
drkameleon Feb 3, 2021
878ca12
build update
drkameleon Feb 3, 2021
a0719ab
build update
drkameleon Feb 3, 2021
4ee6fe6
build update
drkameleon Feb 3, 2021
355be6b
moved common utilities to `common` and updated imports
drkameleon Feb 3, 2021
36d2c9b
build update
drkameleon Feb 3, 2021
acc7b81
build update
drkameleon Feb 3, 2021
efaabde
build update
drkameleon Feb 3, 2021
763cb7b
build update
drkameleon Feb 3, 2021
042be33
build update
drkameleon Feb 3, 2021
4af294e
build update
drkameleon Feb 3, 2021
c835896
build update
drkameleon Feb 3, 2021
f197ec5
build update
drkameleon Feb 3, 2021
80f5ab1
build update
drkameleon Feb 3, 2021
7d65e37
build update
drkameleon Feb 3, 2021
ffc924c
build update
drkameleon Feb 3, 2021
3157cb8
build update
drkameleon Feb 3, 2021
8b87085
build update
drkameleon Feb 3, 2021
b99a8c6
build update
drkameleon Feb 3, 2021
849e973
build update
drkameleon Feb 3, 2021
5161e37
build update
drkameleon Feb 3, 2021
17e66f3
build update
drkameleon Feb 3, 2021
238d7df
build update
drkameleon Feb 3, 2021
3242d31
build update
drkameleon Feb 3, 2021
f671317
build update
drkameleon Feb 3, 2021
4e237ed
build update
drkameleon Feb 3, 2021
bbe5826
removed unused imports
drkameleon Feb 3, 2021
69df6f0
build update
drkameleon Feb 3, 2021
59eb02a
build update
drkameleon Feb 3, 2021
3d0760c
build update
drkameleon Feb 3, 2021
3bd8706
build update
drkameleon Feb 3, 2021
fb46086
build update
drkameleon Feb 3, 2021
1defca1
build update
drkameleon Feb 3, 2021
e4da9a5
build update
drkameleon Feb 3, 2021
d6c6b94
build update
drkameleon Feb 3, 2021
d67cb6a
build update
drkameleon Feb 3, 2021
7fe7bba
build update
drkameleon Feb 3, 2021
366f77b
build update
drkameleon Feb 3, 2021
241ac23
build update
drkameleon Feb 3, 2021
618bf83
build update
drkameleon Feb 3, 2021
7354b97
build update
drkameleon Feb 3, 2021
f0e651c
build update
drkameleon Feb 3, 2021
62be7eb
build update
drkameleon Feb 3, 2021
b21adc5
build update
drkameleon Feb 3, 2021
f8a90e4
build update
drkameleon Feb 3, 2021
fc5b7e3
build update
drkameleon Feb 3, 2021
92cc921
build update
drkameleon Feb 3, 2021
9a6de85
build update
drkameleon Feb 3, 2021
59b46e4
build update
drkameleon Feb 3, 2021
1f8c9cc
build update
drkameleon Feb 3, 2021
584cee6
build update
drkameleon Feb 3, 2021
0ea72e9
build update
drkameleon Feb 3, 2021
a598194
build update
drkameleon Feb 3, 2021
e9dfdd1
build update
drkameleon Feb 3, 2021
6e1ff3d
build update
drkameleon Feb 3, 2021
caddad3
build update
drkameleon Feb 3, 2021
31223b9
build update
drkameleon Feb 3, 2021
2f6fc01
build update
drkameleon Feb 3, 2021
f06d2a5
renamed to Syms, Aliases & Arities
drkameleon Feb 3, 2021
bf6b91e
added createMainStack & createAttrsStack
drkameleon Feb 3, 2021
411d1fc
added createMainStack & createAttrsStack + renamed to Syms, Aliases &…
drkameleon Feb 3, 2021
00b89c3
renamed to Syms, Aliases & Arities + created global Libraries collection
drkameleon Feb 3, 2021
5116faf
renamed to Syms, Aliases & Arities
drkameleon Feb 3, 2021
790dd44
converted system libraries to self-loadable at startup (+ add to Libr…
drkameleon Feb 3, 2021
e0879f4
build update
drkameleon Feb 3, 2021
6509b60
commented-out obsolete code
drkameleon Feb 3, 2021
88faf59
updated .gitignore
drkameleon Feb 3, 2021
d606a3b
build update
drkameleon Feb 3, 2021
5ef3024
build update
drkameleon Feb 3, 2021
d8e94da
removed obsolete code
drkameleon Feb 3, 2021
83135b4
commented out unused/to-be-fixed code
drkameleon Feb 3, 2021
51681d6
removed redundant debugging leftovers
drkameleon Feb 3, 2021
490bc31
build update
drkameleon Feb 3, 2021
f35eea3
build update
drkameleon Feb 3, 2021
a7246b0
build update
drkameleon Feb 3, 2021
816bdca
build update
drkameleon Feb 3, 2021
cf255a3
build update
drkameleon Feb 3, 2021
4a0c48d
build update
drkameleon Feb 3, 2021
01b8ead
build update
drkameleon Feb 3, 2021
73f0933
build update
drkameleon Feb 3, 2021
02981c9
build update
drkameleon Feb 3, 2021
e06fa58
build update
drkameleon Feb 3, 2021
44dc977
build update
drkameleon Feb 3, 2021
0d98eb0
build update
drkameleon Feb 3, 2021
ae37514
build update
drkameleon Feb 3, 2021
0488e07
build update
drkameleon Feb 3, 2021
c4a5a0f
build update
drkameleon Feb 3, 2021
ad5fe72
build update
drkameleon Feb 3, 2021
4638214
build update
drkameleon Feb 3, 2021
0fe01a6
build update
drkameleon Feb 3, 2021
e7f9bb7
build update
drkameleon Feb 3, 2021
4ac86f5
build update
drkameleon Feb 3, 2021
deac5db
build update
drkameleon Feb 3, 2021
51f0c26
build update
drkameleon Feb 3, 2021
e572dea
build update
drkameleon Feb 3, 2021
9f975ec
build update
drkameleon Feb 3, 2021
b5302cc
build update
drkameleon Feb 3, 2021
c2b2084
eliminated obsolete bytecode + updated evaluator + cleaned up system …
drkameleon Feb 3, 2021
1bc47f1
build update
drkameleon Feb 4, 2021
fbcadef
build update
drkameleon Feb 4, 2021
3cd6470
build update
drkameleon Feb 4, 2021
5cce10b
build update
drkameleon Feb 4, 2021
a703f87
build update
drkameleon Feb 4, 2021
0555b7e
build update
drkameleon Feb 4, 2021
e478d08
added DEV flag for developer debugging (and tracking down which libra…
drkameleon Feb 4, 2021
533b903
fixed Unused Symbol warning
drkameleon Feb 4, 2021
544d48b
fixed Unused Symbol warning + renamed `push` to `dup`
drkameleon Feb 4, 2021
cce965f
build update
drkameleon Feb 4, 2021
85b83d2
build update
drkameleon Feb 4, 2021
1ede20b
build update
drkameleon Feb 4, 2021
f485e0f
build update
drkameleon Feb 4, 2021
1718684
build update
drkameleon Feb 4, 2021
bb92a59
build update
drkameleon Feb 4, 2021
7cda1f3
build update
drkameleon Feb 4, 2021
258bdb7
build update
drkameleon Feb 4, 2021
bc17a93
build update
drkameleon Feb 4, 2021
d2fa93b
build update
drkameleon Feb 4, 2021
1437a63
fixed implementation of `getSource` helper
drkameleon Feb 4, 2021
1faf351
fixed implementation of `list`
drkameleon Feb 4, 2021
bc32305
move doc files to /docs
drkameleon Feb 4, 2021
3f5a141
removed obsolete build script
drkameleon Feb 4, 2021
7753f4d
build update
drkameleon Feb 4, 2021
bc65b5c
build update
drkameleon Feb 4, 2021
f851b9b
moved includable script utilities to /tools
drkameleon Feb 4, 2021
4b58563
updated utilities path
drkameleon Feb 4, 2021
c9530d9
updated utilities path and removed FLAGS definition (since it's impor…
drkameleon Feb 4, 2021
0d19704
removed obsolete buildJS task
drkameleon Feb 4, 2021
a810968
fixed options + updated copyright
drkameleon Feb 4, 2021
23ffa03
updated copyright
drkameleon Feb 4, 2021
c1fe350
added author + added dynamic version (from version/version)
drkameleon Feb 4, 2021
e9d12d6
build update
drkameleon Feb 4, 2021
30d81c4
build update
drkameleon Feb 4, 2021
dbce534
added support for two new symbols: lesscolon (`<:`) and minuscolon (`…
drkameleon Feb 4, 2021
60a0e87
replace ampersand (`&`) with thickarrowleft (`<=`) as alias for `dup`
drkameleon Feb 4, 2021
1588ccb
added example for `dup` (`<=`)
drkameleon Feb 4, 2021
6c9858b
added TODO comments for better reference
drkameleon Feb 4, 2021
4e0256a
added TODO references
drkameleon Feb 4, 2021
7e23cb4
build update
drkameleon Feb 4, 2021
1f39f94
fixed evaluation of Paths and PathLabels
drkameleon Feb 4, 2021
9285fb9
build update
drkameleon Feb 4, 2021
7fbbe14
build update
drkameleon Feb 4, 2021
c5a09f1
build update
drkameleon Feb 4, 2021
90fd967
build update
drkameleon Feb 4, 2021
ccf3a56
fixed setter/getter (Path and PathLabel's) implementation
drkameleon Feb 4, 2021
bb3fe73
build update
drkameleon Feb 4, 2021
2e43942
removed redundant comments + added TODO references
drkameleon Feb 4, 2021
451fc57
build update
drkameleon Feb 4, 2021
dc2f482
commented-out irrelevant opcodes
drkameleon Feb 4, 2021
069b21d
renamed constant-push opCodes + cleanup redundant bytecodes
drkameleon Feb 4, 2021
9c92ec4
build update
drkameleon Feb 4, 2021
2a5bf73
build update
drkameleon Feb 4, 2021
c5fde45
build update
drkameleon Feb 4, 2021
7c58456
fixed/renamed older opcodes
drkameleon Feb 4, 2021
d628780
build update
drkameleon Feb 4, 2021
2820e3a
build update
drkameleon Feb 4, 2021
625b597
expanded core opcode range (push/store/call/load) and renamed
drkameleon Feb 4, 2021
d73ace6
better comments + code cleanup
drkameleon Feb 4, 2021
bb11b77
build update
drkameleon Feb 4, 2021
2d57fcd
build update
drkameleon Feb 4, 2021
6b39d9a
build update
drkameleon Feb 4, 2021
570e583
build update
drkameleon Feb 4, 2021
2633be7
build update
drkameleon Feb 4, 2021
fc51f75
complete cleanup of obsolete opcodes + reorganization + added empty o…
drkameleon Feb 4, 2021
213dac5
build update
drkameleon Feb 4, 2021
34535af
fixed comments
drkameleon Feb 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
/.cache
.gitattributes
test
test.nim
test.nim
test.art
old.nim
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ The list of things to fix and/or add could be endless. But here is one, a bit pr
Contributing
------------------------------

Please read [CONTRIBUTING.md](https://github.com/arturo-lang/arturo/blob/master/CONTRIBUTING.md) for more details and the process for submitting pull requests.
Please read [docs/CONTRIBUTING.md](https://github.com/arturo-lang/arturo/blob/master/docs/CONTRIBUTING.md) for more details and the process for submitting pull requests.

**In a few words:** all contributions (even if they are just ideas or suggestions) are 100% welcome!

Expand Down
9 changes: 3 additions & 6 deletions arturo.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
# Arturo
# Programming Language + Bytecode VM compiler
# (c) 2020 Arturo Contributors
# (c) 2021 Yanis Zafirópulos
#
# @file: arturo.nimble
######################################################

# Package

version = "0.9.4"
author = "arturo-lang"
version = static readFile("version/version")
author = "Yanis Zafirópulos"
description = "Simple, modern and portable interpreted programming language for efficient scripting"
license = "MIT"
srcDir = "src"
Expand All @@ -19,7 +20,3 @@ binDir = "bin"
# Dependencies

requires "nim >= 1.4.0"

task buildJS, "build with js backend":
switch("d", "WEB")
selfExec "js src/arturo.nim"
179 changes: 0 additions & 179 deletions build.sh

This file was deleted.

47 changes: 14 additions & 33 deletions config.nims
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,27 @@
# Arturo
# Programming Language + Bytecode VM compiler
# (c) 2020 Arturo Contributors
# (c) 2021 Yanis Zafirópulos
#
# @file: config.nims
######################################################

#switch("warning[UnusedImport]", "off")
switch("checks", "off")
switch("cincludes", "extras")
switch("colors", "off")
#switch("d", "PYTHONIC")
switch("d", "danger")
switch("d", "release")
switch("d", "ssl")
switch("embedsrc", "on")
switch("gc", "orc")
#switch("nimcache", ".cache")
switch("opt", "speed")
switch("overflowChecks", "on")
switch("panics", "off")
switch("threads", "on")
switch("threadAnalysis", "off")
switch("hints", "off")
switch("colors","off")
switch("d","release")
switch("d","danger")
switch("panics","off")
switch("gc","orc")
switch("checks","off")
switch("overflowChecks","on")
switch("d","ssl")
switch("passC","-O3")
switch("cincludes","extras")
switch("nimcache",".cache")
switch("embedsrc","on")
switch("path","src")

when not defined DEBUG:
switch("passC", "-O3")

when defined MINI:
switch("opt", "size")
elif defined VERBOSE:
switch("opt", "speed")
elif defined BENCHMARK:
switch("opt", "speed")
elif defined DEBUG:
switch("linedir", "on")
switch("debugger", "on")
switch("debuginfo", "on")
elif defined PROFILE:
switch("debuginfo", "on")
switch("profiler", "on")
switch("stackTrace", "on")
elif defined WEB:
discard
else:
switch("opt", "speed")
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 3 additions & 23 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# @file: install
######################################################

source utils.sh
source tools/utils.sh

################################################
# FUNCTIONS
Expand Down Expand Up @@ -80,20 +80,6 @@ fi

CONFIG=""
#--warning[UnusedImport]:off\
FLAGS="\
--colors:off\
-d:release\
-d:danger\
--panics:off\
--gc:orc\
--checks:off\
--overflowChecks:on\
-d:ssl\
--passC:"-O3"\
--cincludes:extras\
--nimcache:.cache\
--embedsrc:on\
--path:src"

# check switches

Expand Down Expand Up @@ -133,17 +119,11 @@ else
FLAGS="$FLAGS --opt:speed"
fi

# if $IS_DEV_BUILD; then
# FLAGS="$FLAGS --hint[Performance]:off"
# else
# if ! $PRINT_LOG; then
# FLAGS="$FLAGS --hints:off"
# fi
# fi

if $IS_DEV_BUILD; then
awk '{sub(/[[:digit:]]+$/,$NF+1)}1' version/build > version/build_tmp && mv version/build_tmp version/build
git commit -m 'build update' version/build

FLAGS="$FLAGS -d:DEV"
fi

################################################
Expand Down
2 changes: 1 addition & 1 deletion package
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# @file: package
######################################################

source utils.sh
source tools/utils.sh

################################################
# FUNCTIONS
Expand Down
11 changes: 4 additions & 7 deletions src/arturo.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@
# Libraries
#=======================================

import parseopt, segFaults, tables

when defined(PROFILE):
import nimprof

import parseopt, segFaults, tables

import vm/[version, value, vm]

when defined(BENCHMARK):
import utils

#=======================================
# Types
#=======================================
Expand All @@ -34,13 +31,13 @@ type
showVersion

#=======================================
# Globals
# Constants
#=======================================

# -o --output Compile script and write bytecode
# -i --input Execute script from bytecode

let helpTxt = """
const helpTxt = """

Usage:
arturo [options] <path>
Expand Down
5 changes: 3 additions & 2 deletions src/helpers/datasource.nim
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Libraries
#=======================================

import httpClient, os
import asyncdispatch, httpClient, os

import helpers/url as UrlHelper

Expand All @@ -32,7 +32,8 @@ type

proc getSource*(src: string): DataSource {.inline.} =
if src.isUrl():
result = (newHttpClient().getContent(src), WebData)
let content = waitFor (newAsyncHttpClient().getContent(src))
result = (content, WebData)
elif src.fileExists():
result = (readFile(src), FileData)
else:
Expand Down
Loading