justinmeza / lci Goto Github PK
View Code? Open in Web Editor NEWA LOLCODE interpreter written in C.
Home Page: http://lolcode.org
License: GNU General Public License v3.0
A LOLCODE interpreter written in C.
Home Page: http://lolcode.org
License: GNU General Public License v3.0
When are we going to get the BUKKIT and dictionary functionality? Is this project still alive?
An unclosed OBTW result in a segmation fault.
I can build the main branch fine, but the lci-future branch fails to build for me. The output of make.out is as follows:
Scanning dependencies of target lci
[ 10%] Building C object CMakeFiles/lci.dir/interpreter.c.obj
[ 20%] Building C object CMakeFiles/lci.dir/lexer.c.obj
[ 30%] Building C object CMakeFiles/lci.dir/main.c.obj
C:\temp\lci-future\main.c:112:31: fatal error: readline/readline.h: No such file or directory
compilation terminated.
CMakeFiles\lci.dir\build.make:109: recipe for target 'CMakeFiles/lci.dir/main.c.obj' failed
mingw32-make[2]: *** [CMakeFiles/lci.dir/main.c.obj] Error 1
CMakeFiles\Makefile2:66: recipe for target 'CMakeFiles/lci.dir/all' failed
mingw32-make[1]: *** [CMakeFiles/lci.dir/all] Error 2
Makefile:137: recipe for target 'all' failed
mingw32-make: *** [all] Error 2
Hopefully the project isn't totally dead - would love to see it grow :)
I'm not sure if you can replicate this but I was trying to create a 99 bottles of beer program and I declared a variable called BEERZVAR
and set it to 99. When I print it in a loop, and if I lci
the program, the first thing I see when I scroll up is 0.
As you can see, I handle it by just checking if it's 0 (at the start only) and setting it to 99 manually.
Code is here, cause it's pretty long:
https://codeshare.io/f9J1h
Did I do something wrong with I HAS A BEERZVAR
and BEERZVAR R 99
? I know I can shorten it to I HAS A BEERZVAR ITZ 99
but it gives me the same error.
Can you all please create a standalone version for windows or do you know how I can make one?
I get 'no rule to make target -lm
needed by lci
'
future
branch to master
When I started lci
, my goal was to implement the full 1.2 LOLCODE specification as accurately as possible. That version of lci
is ultimately what resides on the master
branch right now.
Realizing some of the limitations of the 1.2 spec β but without a formal 1.3 spec β others and I started working on implementing and experimenting with new features (like BUKKIT
s and so on) on the future
branch.
Right now the master
branch is in maintenance mode and only gets updated when bugs are fixed. On the other hand, the future
branch sees more active development. It's not a ton of development :) but it's some. And besides, the future
branch has some of the more interesting features including BUKKIT
s, file I/O, and network sockets.
The proposal is simple: I'd like to promote the future
branch to be the master
branch. At the same time, I'd move the current master
branch to be called the 1.2-spec
branch.
This will make it a lot easier for newcomers to discover the most feature-rich version of lci
.
Note that the current implementation in the future
branch has several changes that break compatibility with LOLCODE 1.2. This has allowed us to greatly simplify the code.
Also, there is not published specification for how the current future
branch behaves. I will try and publish a 1.4 spec on the lolcode-spec project. (Note that I'm skipping 1.3 to avoid confusion with the proposed 1.3 specs that can be found on archives of the old lolcode.com site.)
Aside from the branch name change, there won't be much of a noticeable difference. Let me know if you have any thoughts. After a while, if there are no burning issues, I'll make the change.
πΈ
Large program files and/or tight memory constraints can cause segfaults during program buffering. Expected: An exit with an error message.
A sparse file containing a LOLCODE program and trailing NULs will usually run correctly. For example, the following set of commands creates a sparse 1MB file (using something like 4kB on disk) and runs it.
echo "HAI 1.3\nVISIBLE \"hello world\"\nKTHXBYE" > program.lol
dd if=/dev/zero of=program.lol bs=1 count=0 seek=1M
lci program.lol
However, making the file 1TB causes lci
to segfault.
echo "HAI 1.3\nVISIBLE \"hello world\"\nKTHXBYE" > program.lol
dd if=/dev/zero of=program.lol bs=1 count=0 seek=1T
lci program.lol
Here's the variable that keeps track of the buffer size.
Line 144 in 6762b72
Lines 193 to 200 in 6762b72
From what I can tell, two issues contribute to this behavior.
size
is declared as unsigned int
instead of as size_t
. This makes it wrap around at 232 on most systems, even when more than 4GB of RAM is available. At that point, realloc
is asked to resize the buffer to 0 bytes.realloc
isn't checked. If the reallocation is unsuccessful, buffer
is replaced with a null pointer.If you're testing this on your own machine, you may want to limit the memory usage to avoid thrashing. I ran ulimit -v 6291456
to enforce a hard 6GB limit.
This program
HAI 1.2
VISIBLE ":"::"
KTHXBYE
prints ":
as expected. However,
HAI 1.2
VISIBLE ":::""
KTHXBYE
produces the error message test.lol:2: expected token delimiter after string literal
. I would have expected it to print :"
.
It should be mentioned that VISIBLE "::" ":""
solves the problem, but I don't see why the second version would be incorrect.
I ironically would like to make a lot of my dotfiles in LOLCODE, but the lack of a way to call shell commands makes that very difficult. Heres a way it could be implemented:
HAI 1.5
CAN HAS STDIO?
CAN HAS PIPE?
I HAS A pipe
pipe R I IZ PIPE'Z OPEN YR "echo Hello World"
BOTH SAEM pipe AN "Hello World"
O RLY?
YA RLY, VISIBLE "OK"
NO WAI, VISIBLE "SOMFING WENT WONG"
OIC
KTHXBYE
U+D800
(among others) is not a valid Unicode code point according to the UTF-8 standard. However, the LOLCODE interpreter accepts ":(D800)"
without a warning/error and happily writes the incorrect code point to the screen.
Wikipedia says
U+D800 to U+DFFF
The Unicode standard permanently reserves these code point values for UTF-16 encoding of the high and low surrogates, and they will never be assigned a character, so there should be no reason to encode them. The official Unicode standard says that no UTF forms, including UTF-16, can encode these code points.
However UCS-2, UTF-8, and UTF-32 can encode these code points in trivial and obvious ways, and large amounts of software does so even though the standard states that such arrangements should be treated as encoding errors. It is possible to unambiguously encode them in UTF-16 by using a code unit equal to the code point, as long as no sequence of two code units can be interpreted as a legal surrogate pair (that is, as long as a high surrogate is never followed by a low surrogate). The majority of UTF-16 encoder and decoder implementations translate between encodings as though this were the case and Windows allows such sequences in filenames.
In other words, it's not uncommon to accept these code points. Is this something that should/will be fixed, is it intentionally allowed, or is the behavior undefined? (I believe that the specification doesn't cover this.)
When i trie to compile lci I get the following error:
`Running cmake with command:
"cmake ."
and writing results to configure.out.
Error installing: There was a CMake error
`
logs.tar.gz
Is it a bug or user error?
When grabbing an string argument in a library call, make sure to interpolate its contents before using it.
For example: https://github.com/justinmeza/lci/blob/future/binding.c#L84 .
LOLCODE/lci needs the ability to shell out to run stuff on the host OS, so that I can use it to script exploits. For instance:
HAI 1.2
I HAS A THING_TO_DO
THING_TO_DO R "uname -a"
I DUZ THING_TO_DO
VISIBLE IT!
KTHXBYE
I've made the requisite changes and tested it locally, but I don't use GitHub (and I'm currently way too lazy to learn, unfortunately). I'd like to contribute this code back, nonetheless. Would you take a patch?
The following program prints 1
, as expected.
HAI 1.2
VISIBLE SUM OF 0 AN ANY OF FAIL AN WIN MKAY
KTHXBYE
However, according to the specs:
An
MKAY
may be omitted if it coincides with the end of the line/statement, in which case the EOL stands in for as manyMKAY
s as there are open variadic functions.
The way I read this, the program above should be possible to rewrite into the following.
HAI 1.2
VISIBLE SUM OF 0 AN ANY OF FAIL AN WIN
KTHXBYE
But this quits with the error message test.lol:2: expected expression at: end of line
.
Is this a bug in the specification, in the interpreter, or in my understanding of the specs?
EDIT: The description above concerns mathematical operations, but the same goes for SMOOSH
, which is mentioned on its own in the specs.
The line ending may safely implicitly close the
SMOOSH
operator without needing anMKAY
.
The following works for me.
HAI 1.2
SMOOSH "x" AN "y" MKAY
KTHXBYE
But this doesn't (expected expression at: end of line
)
HAI 1.2
SMOOSH "x" AN "y"
KTHXBYE
Create a simple matrix:
I HAS A MATRIZ ITZ A BUKKIT
IM IN YR LOOP UPPIN YR ROW WILE DIFFRINT ROW 5
MATRIZ HAS A SRS ROW ITZ A BUKKIT
IM IN YR INNERLOOP UPPIN YR COL WILE DIFFRINT COL 5
MATRIZ'Z SRS ROW HAS A SRS COL ITZ SUM OF PRODUKT OF ROW 5 COL
IM OUTTA YR INNERLOOP
IM OUTTA YR LOOP
Now try to print it by getting both row and column in a single statement:
IM IN YR LOOP UPPIN YR ROW WILE DIFFRINT ROW 5
IM IN YR INNERLOOP UPPIN YR COL WILE DIFFRINT COL 5
VISIBLE MATRIZ'Z SRS ROW'Z SRS COL " "!
IM OUTTA YR INNERLOOP
VISIBLE " "
IM OUTTA YR LOOP
You get nothing. No error, no wrong output, just nothing.
If we change SRS ROW
to SRS SUM OF ROW 0
:
IM IN YR LOOP UPPIN YR ROW WILE DIFFRINT ROW 5
IM IN YR INNERLOOP UPPIN YR COL WILE DIFFRINT COL 5
VISIBLE MATRIZ'Z SRS SUM OF ROW 0'Z SRS COL " "!
IM OUTTA YR INNERLOOP
VISIBLE " "
IM OUTTA YR LOOP
We get the correct output:
0 1 2 3 4
5 6 7 8 9
10 11 12 13 14
15 16 17 18 19
20 21 22 23 24
The specification says
All variable scope, as of this version, is local to the enclosing function or to the main program block. Variables are only accessible after declaration, and there is no global scope.
This makes me think that a variable should be visible within the function or main program block wherever it's defined, as long as that's above the point where it's accessed. However, the program
HAI 1.2
BOTH SAEM 1 AN 1
O RLY?
YA RLY
I HAS A variable ITZ "Hello World!"
VISIBLE variable
OIC
VISIBLE variable
KTHXBYE
generates the output
Hello World!
/tmp/hello.lol:8 variable does not exist: variable
I guess the actual scope is more narrow than the enclosing function. This seems like a bug to me, either in the implementation or in the specification.
Consider this code:
HAI 1.2
I HAS A FIFTY ITZ 0
IM IN YR TEST UPPIN YR NNN WILE DIFFRINT NNN 100
BOTH SAEM NNN 50, O RLY?
YA RLY, FIFTY R NNN
OIC
IM OUTTA YR TEST
VISIBLE FIFTY
KTHXBYE
I expect this to output 50
, but I get 100
.
If we change the YA RLY
line to YA RLY, FIFTY R SUM OF NNN 0
we correctly get 50
.
Is this a problem with scoping and variables value/reference assignment?
Right now, an unhelpful message like
(null):0 variable does not exist: len
is printed. This should be fixed.
I followed all the instructions to the letter, but no luck.
CMake version installed: 3.10.0-rc2
OS: Windows 7
Python version: 3.6.3
Hey!
Downloaded lci, ran make and make check (all tests passed) and when I run ./lci hai.lol (with hai.lol being the example on your homepage) it just crashes with segmentation fault. What am I doing wrong?
Thanks!
strace output:
execve("./lci", ["./lci", "hai.lol"], [/* 21 vars */]) = 0
brk(0) = 0xbd000
uname({sys="Linux", node="iruel.net", ...}) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4001d000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=34588, ...}) = 0
mmap2(NULL, 34588, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40026000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/libm.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\3741\0\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0644, st_size=652912, ...}) = 0
mmap2(NULL, 684200, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x4002f000
mprotect(0x400cd000, 32768, PROT_NONE) = 0
mmap2(0x400d5000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9e) = 0x400d5000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\314V\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1205684, ...}) = 0
mmap2(NULL, 1242372, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x400d7000
mprotect(0x401fa000, 28672, PROT_NONE) = 0
mmap2(0x40201000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x122) = 0x40201000
mmap2(0x40204000, 9476, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x40204000
close(3) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4001e000
set_tls(0x4001e8a0, 0x4001ef77, 0x4001ef78, 0x4001e8a0, 0x40025000) = 0
mprotect(0x40201000, 8192, PROT_READ) = 0
mprotect(0x400d5000, 4096, PROT_READ) = 0
mprotect(0x40024000, 4096, PROT_READ) = 0
munmap(0x40026000, 34588) = 0
brk(0) = 0xbd000
brk(0xde000) = 0xde000
open("hai.lol", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=74, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4001f000
read(3, "BTW hai.lol\nCAN HAS STDIO?\nHAI 1"..., 4096) = 74
read(3, "", 4096) = 0
close(3) = 0
munmap(0x4001f000, 4096) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Segmentation fault
I have a string, which sometimes comes with a leading :
. So I want to check for this, but right now it's not working. Here's my testing code. It doesn't matter if I get the String with GIMMEH
or a file.
HAI 1.3
CAN HAS STRING?
I HAS A string ITZ "::hello"
I HAS A char ITZ I IZ STRING'Z AT YR string AN YR 0 MKAY
VISIBLE char AN " - " AN "::"
BOTH SAEM char AN "::", O RLY?
YA RLY
VISIBLE "success"
NO WAI
VISIBLE "fail"
OIC
VISIBLE char AN " - " AN ":(3A)"
BOTH SAEM char AN ":(3A)", O RLY?
YA RLY
VISIBLE "success"
NO WAI
VISIBLE "fail"
OIC
BTW gives error: VISIBLE ":[char]" AN " - " AN "COLON"
BOTH SAEM ":[char]" AN "COLON", O RLY?
YA RLY
VISIBLE "success"
NO WAI
VISIBLE "fail"
OIC
I HAS A char2 ITZ I IZ STRING'Z AT YR string AN YR 1 MKAY
VISIBLE char2 AN " - " AN "h"
BOTH SAEM char2 AN "h", O RLY?
YA RLY
VISIBLE "success"
NO WAI
VISIBLE "fail"
OIC
I HAS A char3 ITZ "::"
VISIBLE char3 AN " - " AN "::"
BOTH SAEM char3 AN "::", O RLY?
YA RLY
VISIBLE "success"
NO WAI
VISIBLE "fail"
OIC
KTHXBYE
Any idea?
I am sorely missing a continue
operator, something that allows me to immediately go to the next iteration of a loop. At the moment I have to put everything in a O RLY?
statement.
Here are my suggestions:
DONT CARE
NEVERMIND
Examples:
IM IN YR LOOP UPPIN YR N WILE DIFFRINT N 101
BOTH SAEM MOD OF N 10 0, O RLY?, YA RLY, NEVERMIND, OIC
BTW DO STUFF HERE WHEN N IS NOT DIVISIBLE BY 10
IM OUTTA YR LOOP
I've compiled the future branch (which I cloned with git clone --single-branch --branch future https://github.com/justinmeza/lci.git
) in Ubuntu 16 through the WSL, and when I try to use arrays in accordance with the Advanced Quick Reference, it causes an error.
CMake version: 3.16.3
Make version: GNU 4.2.1 x86_64-pc-linux-gnu
lci --version
: v0.11.2
Code (filename is arrayz.lol):
HAI 1.4
I HAS A array ITZ A BUKKIT
array'Z SRS 1 R 5
VISIBLE array'Z 1
KTHXBYE
Run with:
lci arrayz.lol
Error:
arrayz.lol:7: expected identifier at: 1
arrayz.lol:7: unable to delete unknown identifier type
arrayz.lol:7: expected identifier at: 1
arrayz.lol:5 unable to store variable: array
arrayz.lol:7: unable to delete unknown identifier type
Thanks!
Possibly related to #38.
The 1.2 specification says
Currently, functions do not have access to the outer/calling code block's variables.
Nevertheless, on master
, the following code
HAI 1.2
I HAS A var ITZ "foo"
HOW IZ I func
VISIBLE var
var R "bar"
IF U SAY SO
I IZ func MKAY
VISIBLE var
KTHXBYE
prints
foo
bar
I would have expected an error message about undefined variables.
If a function can in fact modify variables in the outside scope while the specification says that it can't, then it gets harder to track down bugs.
I get 'no rule to make target -lm
needed by lci
'
From the spec I expected to be able to count from, say, 5 to 10 like this:
I HAS A Var ITZ 5
IM IN YR Loopy UPPIN YR Var WILE DIFFRINT Var AN 10
VISIBLE Var
IM OUTTA YR Loopy
But it starts at 0, and the outer Var is still 5 at the end. So how do I do a loop that doesn't start at 0?
With almost every other parsing error I've encountered with lci, this is the only one that doesn't produce an actual error message. We should inform the user as to why their code doesn't not work, telling them they have duplicate literals in their switch statement.
-Kurtis
I expected LIEK
to perform a deep copy of a BUKKIT type'd variable. It seems like it only copies the reference... which means there can only be one instance of my SOCIALCONSTRUCT
.
Use Case: Store some state in an object, then duplicate that object in order to keep a backup of the state.
Behaviour: Modifying the copy also modifies the original
Workaround: Create a new BUKKIT
(not the specific object, just a generic BUKKIT) and manually copy all the properties. The problem with that is the effort and that functions that would belong to the object have to be generalized.
HAI 1.4
OBTW
I HAS A [var] ITZ LIEK A [other var]
Declares a variable and copies the contents of the other variable into the newly created variable. This is only valid if the other variable is a BUKKIT.
According to https://esolangs.org/wiki/LOLCODE
But it does not create a deep copy
TLDR
O HAI IM SOCIALCONSTRUCT
I HAS A PROBBERTY ITZ 100
HOW IZ I DUPLICATIN
I HAS A THING ITZ LIEK A SOCIALCONSTRUCT
THING'Z PROBBERTY R ME'Z PROBBERTY
FOUND YR THING
IF U SAY SO
HOW IZ I CLONINGWEIRDLY
I HAS A THING ITZ A BUKKIT
THING HAS A PROBBERTY ITZ ME'Z PROBBERTY
FOUND YR THING
IF U SAY SO
KTHX
VISIBLE SMOOSH "Original Property is " AN SOCIALCONSTRUCT'Z PROBBERTY MKAY
BTW CREATE A COPY WITH "LIEK"
I HAS A problem ITZ LIEK A SOCIALCONSTRUCT
BTW CREATE A COPY WITH "LIEK" FOLLOWED BY "R"-ASSIGNMENT OF THE PROPERTY
I HAS A sex ITZ problem IZ DUPLICATIN MKAY
BTW CREATE A COPY WITHOUT "LIEK", SIMPLY ASSIGN THE PROPERTY
I HAS A issue
issue R problem IZ CLONINGWEIRDLY MKAY
VISIBLE "------", VISIBLE ""
VISIBLE SMOOSH "problem probberty: " AN problem'Z PROBBERTY MKAY
VISIBLE SMOOSH "sex probberty: " AN sex'Z PROBBERTY MKAY
problem'Z PROBBERTY R 99
VISIBLE SMOOSH "problem probberty: " AN problem'Z PROBBERTY MKAY
VISIBLE SMOOSH "sex probberty: " AN sex'Z PROBBERTY MKAY
VISIBLE "THE VALUE OF SEX'Z PROPERTY CHANGED! BAD!"
VISIBLE ""
problem'Z PROBBERTY R 88
VISIBLE SMOOSH "problem probberty: " AN problem'Z PROBBERTY MKAY
VISIBLE SMOOSH "issue probberty: " AN issue'Z PROBBERTY MKAY
VISIBLE "THE VALUE OF ISSUE'Z PROPERTY DOESNT CHANGE! GUD!"
KTHXBYE
The program
HAI 1.3
SUM OF 1 AN 2
VISIBLE IT
KTHXBYE
executes fine. I'm using IT
as described in the 1.2 spec on expression syntax.
However, when I try to do something more complicated involving IT
, e.g.,
HAI 1.3
SUM OF 1 AN 2
VISIBLE SUM OF IT AN 3
KTHXBYE
I variously get abort traps or segfaults.
bash-3.2$ lci test.lol
6
Segmentation fault: 11
bash-3.2$ lci test.lol
6
lci(39953,0x7fff73c4a300) malloc: *** error for object 0x7feffae05470: incorrect checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug
Abort trap: 6
However, this is an intermittent failure. I can't always seem to produce it. I've been able to reproduce it by modifying this test file and building up to it.
While playing with lolcode, I've isolated the segfaulting code:
HAI 1.2
I HAS A VAR ITZ 1
VAR R ":{VAR}"
VISIBLE VAR
KTHXBYE
In here, the segfault happens only when VISIBLE VAR
is called. I think the problem is with this line:
VAR R "{:VAR}"
after string interpolation of VAR
and overwriting self.
In http://lolcode.org/advanced.html:
Brainfuck (BF), like LOLCODE, is an esoteric programming language. Being Turing-complete, we can use LOLCODE to implement a BF interpreter, as shown in the following source code.
The wikipedia link should be "http://en.wikipedia.org/wiki/Esoteric_programming_language"
Should be http://icanhaslolcode.org/, not .com.
Many people do the things, listed, in order to install.
They run install.py
with their arguments.
They get the error Error installing: There was a CMake error
.
Including me.
Please help.
I'm running Win 8.1 Pro 64-bit btw.
The specification says that BTW
may appear on the same line as other code. Nevertheless, this program
HAI 1.2
OBTW
multi-line comment
TLDR BTW single-line comment
KTHXBYE
exits with
test.lol:4: multiple line comment may not appear on the same line as code
The fopen test fails:
HAI 1.4
CAN HAS STDIO?
I HAS A file
file R I IZ STDIO'Z OPEN YR "read.dat" AN YR "r" MKAY
file R I IZ STDIO'Z OPEN YR "write.dat" AN YR "w" MKAY
file R I IZ STDIO'Z OPEN YR "write.dat" AN YR "a" MKAY
file R I IZ STDIO'Z OPEN YR "write.dat" AN YR "r+" MKAY
file R I IZ STDIO'Z OPEN YR "write.dat" AN YR "w+" MKAY
file R I IZ STDIO'Z OPEN YR "write.dat" AN YR "a+" MKAY
KTHXBYE
Saying: variable does not exist: STDIO
So after I ran cmake and got lci in usr, I downloaded doxygen. However, when I ran cmake again, cmake still wasn't able to find doxygen.
I have just "ported" LOLCODE 1.3 to Windows. Here is the executable for it for those interested:
The following program returns -8
.
HAI 1.2
VISIBLE -010
KTHXBYE
But the following yields the error message test.lol:2: unknown token at: 010
.
HAI 1.2
VISIBLE 010
KTHXBYE
I would have expected octal input to work with neither or both.
These programs are all working as expected (printing 1.00 USD
).
HAI 1.2
VISIBLE 1.0...
" USD"
KTHXBYE
HAI 1.2
VISIBLE 1. ...
" USD"
KTHXBYE
HAI 1.2
VISIBLE 1.β¦
" USD"
KTHXBYE
1 USD
as it's a NUMBR.
HAI 1.2
VISIBLE 1...
" USD"
KTHXBYE
But the following yields test.lol:2: unknown token at: .
.
HAI 1.2
VISIBLE 1....
" USD"
KTHXBYE
Is this intended or a bug?
To quickly make out code samples and for a better structure I propose to reformat the README.md to use Github-flavoured Markdown. I'd do it right away. Any thoughts?
Hi,
Is it OK with you to add a full GPL text file in the repo?
Thanks.
Given an input file like
#!/usr/bin/env lci
without a trailing newline, the interpreter segfaults.
Expected: An error message instead of a crash.
The reason is the following piece of code, which doesn't check the buffer length while searching for trailing '\n'
or '\r'
.
Lines 210 to 215 in 6762b72
(Note that this is a crash that only occurs on malformed input files.)
It would be interesting to make a FIEL
-like BUKKIT
that would be a part of the core library and specification. Maybe some calls like:
FILO = File-like object
Name | Purpose | C-like function |
---|---|---|
LUK |
Read a LETTAR , LINE , or WORD from a FILO |
fscanf() |
SCRIBBEL |
Write a YARN to a FILO |
fprintf() |
AGEIN |
Rewinds the FILO | rewind() |
HAZ |
creates a FILO | n/a |
OPEN |
Opens a file into a FILO | fopen() |
KONN |
Connects a socket to a FILO | connect() |
BIND |
Binds a socket to a FILO | bind() |
Just a stupid question: does this interpreter has an ability to embed it into certain software to make it being a script language of it? Including of two-dimensional calls bindings where you can call C functions from LOL, and call LOL functions from C, and transfer data between both sides, etc. Absolutely the same way on how Lua is used.
I'm using the future branch of lci, and whenever I run a program to write a YARN to a file, I get a Segmentation Fault. The Program is below:
HAI 1.4
CAN HAS STDIO?
I HAS A var ITZ "HAI!!!1!"
I HAS A file ITZ I IZ STDIO'Z OPEN YR "/usr/lol/file.txt" AN YR "r" MKAY
I IZ STDIO'Z DIAF YR file MKAY
O RLY?
YA RLY
I IZ STDIO'Z SCRIBBEL YR file AN YR var MKAY
NO WAI
INVISIBLE "I can't open ur file!!!1!"
OIC
I IZ STDIO'Z CLOSE YR file MKAY
KTHXBYE
Letβs upgrade to Python 3!
Sent with GitHawk
./lci -i
lci> I HAS A foo ITZ 42
lci> VISIBLE foo
interactive:2 variable does not exist: foo
With this code, for exemple: http://pastebin.com/hqGcXeW7
Enter 2 times the same number, smaller than 15 (to see it's not working)
As you can see, BOTH SAEM var1 AN var2 doesn't work inside the loop.
Output:
echo@[routeurDSL]:~/Desktop/do/lolcode$ lci 2.lol
nb : 10
enter same number plz: 10
OUTSIDE LOOP, VAR=VAR?
10=10? 1
INSIDE LOOP, VAR=VAR?
10=0? 0
10=1? 0
10=2? 0
10=3? 0
10=4? 0
10=5? 0
10=6? 0
10=7? 0
10=8? 0
10=9? 0
10=10? 0
10=11? 0
10=12? 0
10=13? 0
10=14? 0
10=15? 0
MEH, DUSNT WORK,GTFO WITH VAR=NUMBER? : 15=15? 1
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.