aheui / rpaheui Goto Github PK
View Code? Open in Web Editor NEWIndustrial-strength implementaiton of Aheui written in RPython with JIT
Home Page: http://aheui.github.io/aheuicon
License: BSD 2-Clause "Simplified" License
Industrial-strength implementaiton of Aheui written in RPython with JIT
Home Page: http://aheui.github.io/aheuicon
License: BSD 2-Clause "Simplified" License
그래서 rpaheui --help
를 해도 Fatal RPython error가 뜹니다.
의도된 것이 아니라면 사용성 편의를 위해 help 시에는 exit code를 0으로 바꾸는게 맞을 것 같습니다.
$ python2 rpaheui/rpaheui.py ./aheui-aheui.aheui -O1 <snippets/hello-world/hello-world.puzzlet.aheui
[Warning] It is running without rlib/jit.
Hello, world!
$ python2 rpaheui/rpaheui.py ./aheui-aheui.aheui -O0 <snippets/hello-world/hello-world.puzzlet.aheui
[Warning] It is running without rlib/jit.
Hello, world!
$ python2 rpaheui/rpaheui.py ./aheui-aheui.aheui -O2 <snippets/hello-world/hello-world.puzzlet.aheui
[Warning] It is running without rlib/jit.
Traceback (most recent call last):
File "rpaheui/rpaheui.py", line 19, in <module>
sys.exit(entry_point(sys.argv))
File "/home/ubuntu/workspace/rpaheui/aheui/aheui.py", line 559, in entry_point
compiler = prepare_compiler(contents, int(str_opt_level), source, aheuic_output, add_debug_info)
File "/home/ubuntu/workspace/rpaheui/aheui/aheui.py", line 534, in prepare_compiler
compiler.optimize2()
File "/home/ubuntu/workspace/rpaheui/aheui/compile.py", line 374, in optimize2
self.optimize_jump()
File "/home/ubuntu/workspace/rpaheui/aheui/compile.py", line 418, in optimize_jump
op, operand = self.lines[direct_target]
IndexError: list index out of range
https://gist.github.com/Sait2000/e4fd8e6b30a85809c08865da137207c7
Makefile을 딱 두 줄 고쳤습니다. RPYTHON
변수하고 cd aheui && $(RPYTHON) $(RPYTHONFLAGS) aheui.py
에서 ../
를 지웠습니다. 안그러면 시작도 안되더라구요.
RPYTHON=/Users/item4/pypy-2.6.1-src/rpython/bin/rpython
RPYTHONFLAGS=--opt=jit
#RPYTHONFLAGS=
all: aheui-c
version:
echo "VERSION='`git describe --tags`'" > aheui/version.py
aheui-c: version
cd aheui && $(RPYTHON) $(RPYTHONFLAGS) aheui.py
clean:
rm aheui-c
install: aheui-c
cp aheui/aheui-c /usr/local/bin/aheui
test:
if [ -e snippets ]; then cd snippets && git pull; else git clone https://github.com/aheui/snippets; fi
cd snippets && AHEUI="../aheui/aheui-c" bash test.sh
testpy:
py.test
if [ -e snippets ]; then cd snippets && git pull; else git clone https://github.com/aheui/snippets; fi
cd snippets && AHEUI=../aheui/aheui.py bash test.sh
진행 상황은 다음과 같습니다.
[item4@item4-mbp rpaheui]$ make
echo "VERSION='`git describe --tags`'" > aheui/version.py
cd aheui && /Users/item4/pypy-2.6.1-src/rpython/bin/rpython --opt=jit aheui.py
[translation:info] 2.7.10 (f3ad1e1e1d62, Aug 28 2015, 09:36:42)
[translation:info] [PyPy 2.6.1 with GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)]
[platform:msg] Set platform with 'host' cc=None, using cc='clang -arch x86_64', version='Unknown'
[translation:info] Translating target as defined by aheui
[platform:execute] clang -arch x86_64 -c -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/gcctest.c -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/gcctest.o
[platform:execute] clang -arch x86_64 /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/gcctest.o -mmacosx-version-min=10.5 -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/gcctest
[platform:execute] clang -arch x86_64 -c -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/gcctest.c -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/gcctest.o
[platform:execute] clang -arch x86_64 /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/gcctest.o -mmacosx-version-min=10.5 -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/gcctest
[translation] translate.py configuration:
[translation] [translate]
[translation] opt = jit
[translation] targetspec = aheui
[translation] translation configuration:
[translation] [translation]
[translation] gc = incminimark
[translation] gcrootfinder = shadowstack
[translation] gctransformer = framework
[translation] jit = True
[translation] list_comprehension_operations = True
[translation] withsmallfuncsets = 5
[translation:info] Annotating&simplifying...
[2b] {translation-task
starting annotate
[translation:info] with policy: rpython.annotator.policy.AnnotatorPolicy
[platform:execute] clang -arch x86_64 -c -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_0.c -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_0.o
[platform:execute] clang -arch x86_64 /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_0.o -mmacosx-version-min=10.5 -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_0
[platform:execute] clang -arch x86_64 -c -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_1.c -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_1.o
[platform:execute] clang -arch x86_64 /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_1.o -mmacosx-version-min=10.5 -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_1
[platform:execute] clang -arch x86_64 -c -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_2.c -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_2.o
[platform:execute] clang -arch x86_64 /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_2.o -mmacosx-version-min=10.5 -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_2
[platform:execute] clang -arch x86_64 -c -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_3.c -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_3.o
[platform:execute] clang -arch x86_64 -c -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_4.c -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_4.o
[platform:execute] clang -arch x86_64 -c -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_5.c -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_5.o
[platform:WARNING] /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_5.c:90:1: warning: expression result unused [-Wunused-value]
[platform:WARNING] utimes;
[platform:WARNING] ^~~~~~
[platform:WARNING] 1 warning generated.
[platform:execute] clang -arch x86_64 /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_5.o -mmacosx-version-min=10.5 -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_5
[platform:execute] clang -arch x86_64 -c -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_6.c -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_6.o
[platform:execute] clang -arch x86_64 /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_6.o -mmacosx-version-min=10.5 -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_6
[platform:execute] clang -arch x86_64 -c -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_7.c -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_7.o
[platform:execute] clang -arch x86_64 /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_7.o -mmacosx-version-min=10.5 -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_7
[platform:execute] clang -arch x86_64 -c -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_8.c -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_8.o
[platform:execute] clang -arch x86_64 /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_8.o -mmacosx-version-min=10.5 -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_8
[platform:execute] clang -arch x86_64 -c -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic -I/Users/item4/pypy-2.6.1-src/rpython/translator/c /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_9.c -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_9.o
[platform:execute] clang -arch x86_64 -c -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic -I/Users/item4/pypy-2.6.1-src/rpython/translator/c /Users/item4/pypy-2.6.1-src/rpython/translator/c/src/thread.c -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/rpython/translator/c/src/thread.o
[platform:execute] clang -arch x86_64 /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_9.o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/rpython/translator/c/src/thread.o -mmacosx-version-min=10.5 -I/Users/item4/pypy-2.6.1-src/rpython/translator/c -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_9
[platform:execute] clang -arch x86_64 -c -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_10.c -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_10.o
[platform:execute] clang -arch x86_64 /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_10.o -mmacosx-version-min=10.5 -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_10
[platform:execute] clang -arch x86_64 -c -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_11.c -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_11.o
[platform:execute] clang -arch x86_64 /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_11.o -mmacosx-version-min=10.5 -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_11
[platform:execute] clang -arch x86_64 -c -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_12.c -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_12.o
[platform:execute] clang -arch x86_64 /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_12.o -mmacosx-version-min=10.5 -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_12
[platform:execute] clang -arch x86_64 -c -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_13.c -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_13.o
[platform:execute] clang -arch x86_64 /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_13.o -mmacosx-version-min=10.5 -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_13
[platform:execute] clang -arch x86_64 -c -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_14.c -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_14.o
[platform:execute] clang -arch x86_64 /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_14.o -mmacosx-version-min=10.5 -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_14
[platform:execute] clang -arch x86_64 -c -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_15.c -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_15.o
[platform:execute] clang -arch x86_64 /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_15.o -mmacosx-version-min=10.5 -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_15
[platform:execute] clang -arch x86_64 -c -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_16.c -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_16.o
[platform:WARNING] /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_16.c:98:1: warning: expression result unused [-Wunused-value]
[platform:WARNING] ftime;
[platform:WARNING] ^~~~~
[platform:WARNING] 1 warning generated.
[platform:execute] clang -arch x86_64 /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_16.o -mmacosx-version-min=10.5 -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_16
[platform:execute] clang -arch x86_64 -c -O3 -fomit-frame-pointer -mmacosx-version-min=10.5 -mdynamic-no-pic /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_17.c -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_17.o
[platform:WARNING] /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_17.c:98:1: warning: expression result unused [-Wunused-value]
[platform:WARNING] gettimeofday;
[platform:WARNING] ^~~~~~~~~~~~
[platform:WARNING] 1 warning generated.
[platform:execute] clang -arch x86_64 /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_17.o -mmacosx-version-min=10.5 -o /var/folders/xv/1bk19gh52hqf4_x199v_w1b80000gn/T/usession-release-2.6.1-4/platcheck_17
..............................+++++++++++++++++++++++++++++++++++++++++++[221] translation-task}
[translation:info] RTyping...
[221] {translation-task
starting rtype_lltype
..............................++++++++++++++++++++++++++++++++++++++++++++++++++
..........................++++++++++++++++++++++++*##*++++++++++++++++++++++++++
.......................++++++++++++++++++++++++***%%##%%%%************++++++++++
................++++++++++++++++++++++++********%%%%%%#%%%%******************+++
...........++++++++++++++*******************%%%##%#######%#%%%******************
.......++++++++++****
[rtyper] specializing: 200 / 3061 blocks (6%)
.......++++++++++*************************%%%%%%###########%%%%%****************
....+++++++++***********************#%%#%%%%##%#############%%%%%%%%**%#********
..+++++++************%%%%%%%%%%%%%%
[rtyper] specializing: 500 / 4035 blocks (12%)
..+++++++************%%%%%%%%%%%%%%%%%#################################%%*******
++++++**********%%%%%%%%%%%%%%%%%%%%%##################################%%%%%****
++++********%%%%%%%%%%%%%%%%%%%%%%#####################################%%%%%%%**
++********%%%#%%%#%%%#%###################################################%%%%%%
+*******%%%%%%%###################[996] translation-task}
[Timer] Timings:
[Timer] annotate --- 6.3 s
[Timer] rtype_lltype --- 19.2 s
[Timer] =========================================
[Timer] Total: --- 25.5 s
[translation:info] Error:
[translation:info] File "/Users/item4/pypy-2.6.1-src/rpython/translator/goal/translate.py", line 318, in main
[translation:info] drv.proceed(goals)
[translation:info] File "/Users/item4/pypy-2.6.1-src/rpython/translator/driver.py", line 551, in proceed
[translation:info] return self._execute(goals, task_skip = self._maybe_skip())
[translation:info] File "/Users/item4/pypy-2.6.1-src/rpython/translator/tool/taskengine.py", line 114, in _execute
[translation:info] res = self._do(goal, taskcallable, *args, **kwds)
[translation:info] File "/Users/item4/pypy-2.6.1-src/rpython/translator/driver.py", line 279, in _do
[translation:info] res = func()
[translation:info] File "/Users/item4/pypy-2.6.1-src/rpython/translator/driver.py", line 346, in task_rtype_lltype
[translation:info] rtyper.specialize(dont_simplify_again=True)
[translation:info] File "/Users/item4/pypy-2.6.1-src/rpython/rtyper/rtyper.py", line 176, in specialize
[translation:info] self.specialize_more_blocks()
[translation:info] File "/Users/item4/pypy-2.6.1-src/rpython/rtyper/rtyper.py", line 216, in specialize_more_blocks
[translation:info] self.specialize_block(block)
[translation:info] File "/Users/item4/pypy-2.6.1-src/rpython/rtyper/rtyper.py", line 304, in specialize_block
[translation:info] self.translate_hl_to_ll(hop, varmapping)
[translation:info] File "/Users/item4/pypy-2.6.1-src/rpython/rtyper/rtyper.py", line 430, in translate_hl_to_ll
[translation:info] resultvar = hop.dispatch()
[translation:info] File "/Users/item4/pypy-2.6.1-src/rpython/rtyper/rtyper.py", line 647, in dispatch
[translation:info] return translate_meth(self)
[translation:info] File "<217-codegen /Users/item4/pypy-2.6.1-src/rpython/rtyper/rtyper.py:506>", line 5, in translate_op_mod
[translation:info] return pair(r_arg1, r_arg2).rtype_mod(hop)
[translation:info] File "/Users/item4/pypy-2.6.1-src/rpython/rtyper/rtuple.py", line 367, in rtype_mod
[translation:info] return r_str.ll.do_stringformat(hop, sourcevars)
[translation:info] File "/Users/item4/pypy-2.6.1-src/rpython/rtyper/lltypesystem/rstr.py", line 1167, in do_stringformat
[translation:info] vchunk = hop.gendirectcall(r_arg.ll_unicode, vitem)
[translation:info] File "/Users/item4/pypy-2.6.1-src/rpython/rtyper/rmodel.py", line 107, in __getattr__
[translation:info] self.__class__.__name__, name))
[translation:ERROR] AttributeError: IntegerRepr instance has no attribute ll_unicode
[translation] start debugger...
> /Users/item4/pypy-2.6.1-src/rpython/rtyper/rmodel.py(107)__getattr__()
-> self.__class__.__name__, name))
(Pdb+) ㅊ
(Pdb+) c
make: *** [aheui-c] Error 1
pypy v7.3.13 까지는 동작하고 이후부터 깨짐
pypy 최신버전을 bitbucket에서 clone하고, make install
로 rpaheui를 설치하면, 어느 정도 진행되다가 다음과 같은 에러가 발생하면서 pdb가 실행됩니다.
예전에 설치했을 때 이런 문제가 없었던거 보면 pypy가 변경되서 생긴 문제인 것 같습니다.
[translation:info] Error:
File "/mnt/e/wsl/pypy/rpython/translator/goal/translate.py", line 318, in main
drv.proceed(goals)
File "/mnt/e/wsl/pypy/rpython/translator/driver.py", line 551, in proceed
result = self._execute(goals, task_skip = self._maybe_skip())
File "/mnt/e/wsl/pypy/rpython/translator/tool/taskengine.py", line 114, in _execute
res = self._do(goal, taskcallable, *args, **kwds)
File "/mnt/e/wsl/pypy/rpython/translator/driver.py", line 278, in _do
res = func()
File "/mnt/e/wsl/pypy/rpython/translator/driver.py", line 345, in task_rtype_lltype
rtyper.specialize(dont_simplify_again=True)
File "/mnt/e/wsl/pypy/rpython/rtyper/rtyper.py", line 187, in specialize
self.specialize_more_blocks()
File "/mnt/e/wsl/pypy/rpython/rtyper/rtyper.py", line 224, in specialize_more_blocks
self.specialize_block(block)
File "/mnt/e/wsl/pypy/rpython/rtyper/rtyper.py", line 309, in specialize_block
hop.setup() # this is called from here to catch TyperErrors...
File "/mnt/e/wsl/pypy/rpython/rtyper/rtyper.py", line 633, in setup
rtyper.call_all_setups() # compute ForwardReferences now
File "/mnt/e/wsl/pypy/rpython/rtyper/rtyper.py", line 255, in call_all_setups
r.setup_final()
File "/mnt/e/wsl/pypy/rpython/rtyper/rmodel.py", line 75, in setup_final
self._setup_repr_final()
File "/mnt/e/wsl/pypy/rpython/rtyper/rclass.py", line 594, in _setup_repr_final
self._setup_immutable_field_list()
File "/mnt/e/wsl/pypy/rpython/rtyper/rclass.py", line 638, in _setup_immutable_field_list
self._parse_field_list(immutable_fields, accessor, hints)
File "/mnt/e/wsl/pypy/rpython/rtyper/rclass.py", line 671, in _parse_field_list
"(got %r)" % (fullname, self, name, r))
[translation:ERROR] TyperError: _immutable_fields_ = ['labels[*]'] in <InstanceRepr for aheui.aheui.Program>, but 'labels' is not a list (got <OrderedDictRepr * GcStruct dicttable { num_live_items, num_ever_used_items, resize_counter, indexes, lookup_function_no, entries }>)
.. (aheui.aheui:537)entry_point
.. block@133[compiler_0] with 1 exits
.. program_0 = simple_call((type Program), v262, v263)
[translation] start debugger...
> /mnt/e/wsl/pypy/rpython/rtyper/rclass.py(671)_parse_field_list()
-> "(got %r)" % (fullname, self, name, r))
rpaheui-1.2.2-17-g49f1f4d python-2.7.10 pypy2-5.10.0
literary/huntcook.aheui 스니펫을 완전히 파싱해내지 못합니다.
다음 gist는 [9, 0]의 요
가 마지막 명령인 앟셈블리 코드입니다: huntcook.aheuis
아래는 -Trun
시 무한 루프에 빠져 메모리 괴물이 되는 모습입니다.
코드의 대부분이 첫소리가 ㅇ
인 코드가 있는데 주석이 코드보다 훨씬 깁니다.
hello-big-big.aheuis.txt
Ubuntu에서 apt install pypy로 pypy를 설치한 후 rpaheui에서 make install을 하면 설치가 진행되다
`
[translation:info] Error:
File "/home/vantaa/pypy/rpython/translator/goal/translate.py", line 318, in main
drv.proceed(goals)
File "/home/vantaa/pypy/rpython/translator/driver.py", line 551, in proceed
result = self._execute(goals, task_skip = self._maybe_skip())
File "/home/vantaa/pypy/rpython/translator/tool/taskengine.py", line 114, in _execute
res = self._do(goal, taskcallable, *args, **kwds)
File "/home/vantaa/pypy/rpython/translator/driver.py", line 278, in _do
res = func()
File "/home/vantaa/pypy/rpython/translator/driver.py", line 359, in task_pyjitpl_lltype
from rpython.jit.metainterp.warmspot import apply_jit
File "/home/vantaa/pypy/rpython/jit/metainterp/warmspot.py", line 21, in
from rpython.jit.metainterp import history, pyjitpl, gc, memmgr, jitexc
File "/home/vantaa/pypy/rpython/jit/metainterp/pyjitpl.py", line 8, in
from rpython.jit.metainterp import history, compile, resume, executor, jitexc
File "/home/vantaa/pypy/rpython/jit/metainterp/executor.py", line 14, in
from rpython.jit.metainterp.blackhole import BlackholeInterpreter, NULL
File "/home/vantaa/pypy/rpython/jit/metainterp/blackhole.py", line 16, in
from rpython.rlib.jit_libffi import CIF_DESCRIPTION_P
File "/home/vantaa/pypy/rpython/rlib/jit_libffi.py", line 4, in
from rpython.rlib import clibffi, jit
File "/home/vantaa/pypy/rpython/rlib/clibffi.py", line 82, in
include_dirs = platform.include_dirs_for_libffi(),
File "/home/vantaa/pypy/rpython/translator/platform/init.py", line 240, in include_dirs_for_libffi
dirs = self._include_dirs_for_libffi()
File "/home/vantaa/pypy/rpython/translator/platform/linux.py", line 33, in _include_dirs_for_libffi
check_result_dir=True)
File "/home/vantaa/pypy/rpython/translator/platform/posix.py", line 91, in _pkg_config
raise ValueError(msg)
[translation:ERROR] ValueError: running 'pkg-config libffi --cflags-only-I' failed:
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing 'libffi.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libffi' found
and the default ['/usr/include/libffi'] is not a valid directory
[translation] start debugger...
/home/vantaa/pypy/rpython/translator/platform/posix.py(91)_pkg_config()
-> raise ValueError(msg)
(Pdb+)
Traceback (most recent call last):
File "../pypy/rpython/bin/rpython", line 20, in
main()
File "/home/vantaa/pypy/rpython/translator/goal/translate.py", line 325, in main
debug(True)
File "/home/vantaa/pypy/rpython/translator/goal/translate.py", line 278, in debug
pdb_plus_show.start(tb)
File "/home/vantaa/pypy/rpython/translator/tool/pdbplus.py", line 442, in start
fn(*args)
File "/home/vantaa/pypy/rpython/translator/tool/pdbplus.py", line 25, in post_mortem
self.interaction(t.tb_frame, t)
File "/usr/lib/pypy/lib-python/2.7/pdb.py", line 210, in interaction
self.cmdloop()
File "/usr/lib/pypy/lib-python/2.7/cmd.py", line 130, in cmdloop
line = raw_input(self.prompt)
File "/usr/lib/pypy/lib_pypy/pyrepl/readline.py", line 258, in raw_input
return reader.readline(startup_hook=self.startup_hook)
File "/usr/lib/pypy/lib_pypy/pyrepl/reader.py", line 604, in readline
self.handle1()
File "/usr/lib/pypy/lib_pypy/pyrepl/reader.py", line 587, in handle1
self.do_cmd(cmd)
File "/usr/lib/pypy/lib_pypy/pyrepl/reader.py", line 534, in do_cmd
cmd.do()
File "/usr/lib/pypy/lib_pypy/pyrepl/commands.py", line 184, in do
os.kill(os.getpid(), signal.SIGINT)
KeyboardInterrupt
Makefile:16: 'aheui-c' 타겟에 대한 명령이 실패했습니다
make: *** [aheui-c] 오류 1
KeyboardInterrupt Makefile:16: 'aheui-c' 타겟에 대한 명령이 실패했습니다 make: *** [aheui-c] 오류 1
이렇게 에러가 납니다.
제가 리눅스를 잘 몰라서 제가 잘못했을 가능성이 큰 것 같은데.. 어떻게 해야 될지를 모르겠습니다
pypy를 clone하고 pypy안에 rpaheui를 받아서 넣어둔 상태입니다
make를 치자
❯ make
echo "VERSION = '`git describe --tags`'" > aheui/version.py
../pypy/rpython/bin/rpython --opt=jit rpaheui.py
process_begin: CreateProcess(NULL, ../pypy/rpython/bin/rpython --opt=jit rpaheui.py, ...) failed.
make (e=2): 지정된 파일을 찾을 수 없습니다.
make: *** [aheui-c] 오류 2
라며 오류가 발생합니다
python bin/aheui -O2 --target=asm -c 반반따희
PUSH 2
L1: PUSH 2
BRPOP2 L1
MUL
HALT
line0-3 이 PUSH4 로 최적화되어야 하나 되지 않음.
logo 기준 이 최적화의 기여도는 20% 정도
알파희 언어 명세를 자세히 보려면 어떻게 해야 하나요? 아희 공식 언어 명세에 정확히 명시되지 않은 부분들을 알파희가 어떻게 구현했는지 확인하고 싶습니다.
예를 들어서 아희 공식 명세에서는 정수형을 이진법 숫자 32개 이상의 부호 있는 정수형을 사용할 것을 권고하고 있는데, 알파희의 구현이 궁금합니다. 또한, 아희 공식 명세에서는 방
명령어가 잘못된 입력을 받았거나, 밯
명령어가 표준 입력의 끝을 만났을 때 어떻게 행동하는지 정해져있지 않습니다. (백준 문제 풀다보니 필요합니다.)
아희 공식 명세에 없는 부분들은 이 글의 제안-보완
을 참고하려고 했는데, 그것도 아닌 것 같더라고요...
MRE:
발밤박망써희
이 코드는 써
를 써서 데이터를 옮기지 않고 현재 스택에 데이터가 존재하는지 여부를 가지고 branch하는 코드입니다. 예상 동작은 스택에 넣은 역순으로 모든 수를 출력 후 종료하는 것으로, AVIS에서 실행 시 예상대로 245
가 출력됩니다. 하지만 rpaheui에서는 24
만 출력하고 종료되는데, 이는 저장공간과 별도로 현재 저장공간의 크기를 트래킹하는 stacksize
가 써
에서 1 줄어들고, 다시 같은 저장공간에 넣었음에도 다시 1 늘어나지 않아서 생긴 문제로 보입니다.
원래는 스택 길이가 0이 되면 종료하는 코드가 -O1에서 검사가 사라져서 에러가 발생합니다.
바뱌희빠마며
; python2.7, 1.2.2, -O0
L0: PUSH 0 ; L0 바 / [ 0, 0] RIGHT1
PUSH 0 ; L1 뱌 / [ 0, 1] RIGHT2
L2: BRPOP1 L9 ; L2
DUP ; L3 빠 / [ 0, 3] RIGHT1
BRPOP1 L10 ; L4
POP ; L5 마 / [ 0, 4] RIGHT1
BRPOP1 L11 ; L6
POP ; L7 며 / [ 0, 5] LEFT 2
JMP L2 ; L8
L9: HALT ; L9 희 / [ 0, 2] LEFT 1
L10: JMP L2 ; L10
L11: JMP L0 ; L11
; python2.7, 1.2.2, -O1
PUSH 0 ; L0 바 / [ 0, 0] RIGHT1
PUSH 0 ; L1 뱌 / [ 0, 1] RIGHT2
L2: DUP ; L2 빠 / [ 0, 3] RIGHT1
POP ; L3 마 / [ 0, 4] RIGHT1
POP ; L4 며 / [ 0, 5] LEFT 2
JMP L2 ; L5
; python2.7, 1.2.2, -O2
PUSH 0 ; L0 바 / [ 0, 0] RIGHT1
PUSH 0 ; L1 뱌 / [ 0, 1] RIGHT2
L2: BRPOP1 L7 ; L2
DUP ; L3 빠 / [ 0, 3] RIGHT1
POP ; L4 마 / [ 0, 4] RIGHT1
POP ; L5 며 / [ 0, 5] LEFT 2
JMP L2 ; L6
L7: HALT ; L7 희 / [ 0, 2] LEFT 1
빌드 가능한 마지막버전 확인하지 않음.
7.0.0 이후로는 빌드 안됨.
혼자서 pyenv에서 여러 가지 버전을 가지고 삽질해본 결과 아래의 순서대로 실행하니 됐습니다.
Prerequisite: pyenv 설치 (https://github.com/pyenv/pyenv)
pyenv install 2.7.18
pyenv global 2.7.18
pyenv install pypy2.7-7.0.0-src # 약 2시간 이상 걸림
RPYTHON=$(pyenv root)/pypy2.7-7.0.0-src/rpython/bin/rpython make
Note: RPython 7.1.0 이상에서는 str와 bytes를 섞어 쓰는 것이 금지되었기 때문에 빌드가 되지 않습니다.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.