GithubHelp home page GithubHelp logo

xkbeyer / liquid Goto Github PK

View Code? Open in Web Editor NEW
89.0 89.0 13.0 201 KB

Toy programming language using LLVM, flex and bison.

License: MIT License

C++ 83.77% C 0.65% Yacc 5.91% Lex 5.04% CMake 4.62%

liquid's People

Contributors

xkbeyer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

liquid's Issues

Not a problem, but a praise.

Nice job making a new language. I've tried making one, called Python++, but it definitely doesn't have as much functionality as this does. Nice going!

Cast

How do i cast from a string to an int?
The error codes say that I'm missing a cast, but how do i cast

Builtins missing

I just cloned and built this project, and any examples I try to run throw an error like "LLVM ERROR: Program used external function 'displayln' which could not be resolved!". It appears to happen for any builtin function. I can't see any reason why though.

Cannot compile / run scrips

Hi there! I am super interested in this project but, I am having a little bit of trouble compiling and running scripts.

Script

printvalue(1);

Command to run

$ ./liq test.liq

output


Usage:
liq filename -h -d -v -q -i path1;path2
	-h this help text.
	-d debug code generation. Disables the code optimizer pass.
	-v be more verbose.
	-q be quiet.
	-i semicolon separated list of import paths where additional liquid files are located.

Other info

I modified tokens.cpp and removed register so I could compile liq.

Issue with arrays

I get the following error when running the "test_array.liq" file or any other file containing arrays :-

liquid version 0.3.2
Generating code...
liq: /home/sylvette/.local/include/llvm/IR/Instructions.h:974: static llvm::GetElementPtrInst* llvm::GetElementPtrInst::Create(llvm::Type*, llvm::Value*, 
llvm::ArrayRef<llvm::Value*>, const llvm::Twine&, llvm::BasicBlock*): 
Assertion `cast<PointerType>(Ptr->getType()->getScalarType()) ->isOpaqueOrPointeeTypeMatches(PointeeType)' failed.
Aborted (core dumped)

make has some trouble with llvm

Hi,

I've ubuntu 16.04 LTS
cmake 3.11.0
LLVM 7

claudio@claudio:~/Downloads/liquid/build$ make
/usr/local/bin/cmake -H/home/claudio/Downloads/liquid -B/home/claudio/Downloads/liquid/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/local/bin/cmake -E cmake_progress_start /home/claudio/Downloads/liquid/build/CMakeFiles /home/claudio/Downloads/liquid/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/claudio/Downloads/liquid/build'
make -f CMakeFiles/liq.dir/build.make CMakeFiles/liq.dir/depend
make[2]: Entering directory '/home/claudio/Downloads/liquid/build'
cd /home/claudio/Downloads/liquid/build && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" /home/claudio/Downloads/liquid /home/claudio/Downloads/liquid /home/claudio/Downloads/liquid/build /home/claudio/Downloads/liquid/build /home/claudio/Downloads/liquid/build/CMakeFiles/liq.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/claudio/Downloads/liquid/build'
make -f CMakeFiles/liq.dir/build.make CMakeFiles/liq.dir/build
make[2]: Entering directory '/home/claudio/Downloads/liquid/build'
[  5%] Building CXX object CMakeFiles/liq.dir/main.cpp.o
/usr/bin/c++  -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/include -I/home/claudio/Downloads/liquid -I/home/claudio/Downloads/liquid/build  -g   -Wall -std=gnu++1z -o CMakeFiles/liq.dir/main.cpp.o -c /home/claudio/Downloads/liquid/main.cpp
In file included from /home/claudio/Downloads/liquid/main.cpp:8:0:
/home/claudio/Downloads/liquid/CodeGenContext.h:14:28: fatal error: llvm/IR/Module.h: No such file or directory
compilation terminated.
CMakeFiles/liq.dir/build.make:76: recipe for target 'CMakeFiles/liq.dir/main.cpp.o' failed
make[2]: *** [CMakeFiles/liq.dir/main.cpp.o] Error 1
make[2]: Leaving directory '/home/claudio/Downloads/liquid/build'
CMakeFiles/Makefile2:102: recipe for target 'CMakeFiles/liq.dir/all' failed
make[1]: *** [CMakeFiles/liq.dir/all] Error 2
make[1]: Leaving directory '/home/claudio/Downloads/liquid/build'
Makefile:86: recipe for target 'all' failed
make: *** [all] Error 2
claudio@claudio:~/Downloads/liquid/build$ make
/usr/local/bin/cmake -H/home/claudio/Downloads/liquid -B/home/claudio/Downloads/liquid/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/local/bin/cmake -E cmake_progress_start /home/claudio/Downloads/liquid/build/CMakeFiles /home/claudio/Downloads/liquid/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/home/claudio/Downloads/liquid/build'
make -f CMakeFiles/liq.dir/build.make CMakeFiles/liq.dir/depend
make[2]: Entering directory '/home/claudio/Downloads/liquid/build'
cd /home/claudio/Downloads/liquid/build && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" /home/claudio/Downloads/liquid /home/claudio/Downloads/liquid /home/claudio/Downloads/liquid/build /home/claudio/Downloads/liquid/build /home/claudio/Downloads/liquid/build/CMakeFiles/liq.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/claudio/Downloads/liquid/build'
make -f CMakeFiles/liq.dir/build.make CMakeFiles/liq.dir/build
make[2]: Entering directory '/home/claudio/Downloads/liquid/build'
[  5%] Building CXX object CMakeFiles/liq.dir/main.cpp.o
/usr/bin/c++  -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/include -I/home/claudio/Downloads/liquid -I/home/claudio/Downloads/liquid/build  -g   -Wall -std=gnu++1z -o CMakeFiles/liq.dir/main.cpp.o -c /home/claudio/Downloads/liquid/main.cpp
In file included from /home/claudio/Downloads/liquid/main.cpp:8:0:
/home/claudio/Downloads/liquid/CodeGenContext.h:14:28: fatal error: llvm/IR/Module.h: No such file or directory
compilation terminated.
CMakeFiles/liq.dir/build.make:76: recipe for target 'CMakeFiles/liq.dir/main.cpp.o' failed
make[2]: *** [CMakeFiles/liq.dir/main.cpp.o] Error 1
make[2]: Leaving directory '/home/claudio/Downloads/liquid/build'
CMakeFiles/Makefile2:102: recipe for target 'CMakeFiles/liq.dir/all' failed
make[1]: *** [CMakeFiles/liq.dir/all] Error 2
make[1]: Leaving directory '/home/claudio/Downloads/liquid/build'
Makefile:86: recipe for target 'all' failed
make: *** [all] Error 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.