lci icon indicating copy to clipboard operation
lci copied to clipboard

Socket/File support?

Open Xe opened this issue 10 years ago • 6 comments

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()

Xe avatar Apr 27 '14 02:04 Xe

I think this is a good idea! Have you happened to see some of the more recent commits on the "future" branch to support binding to external libraries? I'm still working out the right interface for binding, but I have some examples with some basic file I/O and string manipulation in "binding.c" (BTW, I'm horrible at coming up with LOL-worthy names, so feel free to suggest some better ones!). I think that we can potentially encapsulate these functions using the same interface. Take a look and let me know what you think.

We'll probably want to come up with a set of commands that provide enough functionality to build interesting programs. Feel free to hop on IRC to discuss, I can also set up a forum to document these things, or maybe GitHub is good enough?

justinmeza avatar Apr 27 '14 02:04 justinmeza

Hi,

I'm checking out the future branch, and having a play with SOCKS. I'm attempting to send a newline, however the literal string seems to be passed when I try things like:

I IZ SOCKS'Z PUT YR socket AND YR conn AN YR "blah:)" MKAY

Is there any way to send newlines?

arth avatar May 09 '14 14:05 arth

Ah, I think this is a bug with string interpolation in library calls. Thanks for catching that. Right now, when a library call gets a string as an argument, it does not interpolate it. I will file a separate issue for fixing that.

One thing that will work is assigning the string to a variable and passing that to the SOCKS calls. Here's an example that I've checked works: https://github.com/justinmeza/httpd.lol/blob/master/httpd.lol#L68-L77 .

justinmeza avatar May 09 '14 15:05 justinmeza

Ah, I had thought about doing that as a workaround, but I thought I'd ask first.

Thanks!

arth avatar May 09 '14 15:05 arth

OK, I just pushed a commit that interpolates strings in library calls.

justinmeza avatar May 10 '14 04:05 justinmeza

We'll probably want to come up with a set of commands that provide enough functionality to build interesting programs. Feel free to hop on IRC to discuss, I can also set up a forum to document these things, or maybe GitHub is good enough?

Don't know where else to put this. On the forum register page (http://forum.lolcode.org/ucp.php?mode=register), there is no text field for the captcha. I have tried it with IE, Chrome, and Firefox, but it's all the same. Can't register.

lar3ry avatar Aug 30 '19 17:08 lar3ry