Jump to content


ElvishJerricco's Content

There have been 86 items by ElvishJerricco (Search limited from 30-March 23)


By content type

See this member's


Sort by                Order  

#248990 [MC 1.7.10] [CC 1.65] Immibis's Peripherals

Posted by ElvishJerricco on 27 March 2016 - 11:51 PM in Peripherals and Turtle Upgrades

View Postimmibis, on 27 March 2016 - 11:46 PM, said:

View PostChaz, on 22 January 2016 - 06:36 AM, said:

Are there any plans to bring Immibis' Peripherals up to 1.8.9/CC 1.78?

Why would anyone voluntarily use Minecraft 1.8?

Perhaps the situation is different for servers with a handful of small mods, like ComputerCraft-only servers.

Minecraft 1.8 has come a looooong way since it came out. With developments in Forge, the API has actually come up to par with 1.7. It's quickly becoming the prominent modding version until 1.9 gets all sorted out.



#247966 [1.7.4] Bugs in os.loadAPI

Posted by ElvishJerricco on 13 March 2016 - 07:03 PM in Bugs

I think issue 1 is a part of a larger issue. CC in general doesn't respect file extensions. Programs with file extensions require you to enter the file extension when trying to run the program, which makes sense if you come from any other command line environment. It is consistent then for os.loadAPI not to respect file extensions.

Issue 2 is by design I think. It is undesirable for users to be able to modify an API.

That said, CC really does need a better API system.



#246346 ClamShell - Advanced Shell With a Shell Language and Bash-like Piping

Posted by ElvishJerricco on 22 February 2016 - 04:49 AM in Programs

Awesome changes! Feel free to send me anything you'd like me to add / change / rewrite-from-scratch in the OP =P



#245774 JSON API v2.0.1 for ComputerCraft

Posted by ElvishJerricco on 15 February 2016 - 09:53 PM in APIs and Utilities

Got it. Somehow my testing didn't reveal a flaw in the string parsing. Fixed now.



#245763 JSON API v2.0.1 for ComputerCraft

Posted by ElvishJerricco on 15 February 2016 - 09:44 PM in APIs and Utilities

 kd8lvt, on 15 February 2016 - 04:43 PM, said:

Hello! My Twitch.tv interfacing api depends on your JSON api, and it really is great and easy to use, however, with the newest version of your api, whenever a new computer downloads the JSON api (I have it auto downloading from your pastebin) the computer locks up, then reboots. No error message, and it has no reason to do it either, it seems. So, for now I am reuploading an older version while I hope and pray that this magically gets fixed. I'm sorry I can't provide more details on the matter other than "the computer locks up, then reboots". If I could, I would.
Thanks!
~Kd
[Edit] I am using json.decode, if that helps.

Weird. Worked when I tested it. But I only tested it with the C, command line version of Lua. Didn't try it in Minecraft.



#245619 JSON API v2.0.1 for ComputerCraft

Posted by ElvishJerricco on 14 February 2016 - 07:26 PM in APIs and Utilities

Fixed. Let me know if issues persist.



#245612 JSON API v2.0.1 for ComputerCraft

Posted by ElvishJerricco on 14 February 2016 - 07:02 PM in APIs and Utilities

I cannot replicate the first problem.

The second is caused by some really lazy string handling on my part. You really shouldn't be transferring code in Json but that's beside the point =P What I wrote works for any normal use case of json, but for something like this it broke. I'll get to fixing it.



#242435 What is the difference between shell.run() and os.run()

Posted by ElvishJerricco on 05 January 2016 - 06:22 AM in Ask a Pro

As Creator said, you can specify the environment with os.run.

-- program.lua
sandboxedGlobal = 3

-- run program.lua
local env = {}
os.run(env, "program.lua")
print(env.sandboxedGlobal) -- 3

But shell.run does NOT use _G. Each shell (most people usually only have one shell open) creates its own environment that it uses between all the programs it runs. So globals a program makes when run through the shell will be accessible to any other program run from the same shell. Furthermore, using shell.run gives access to the shell API, and makes it play nicely. Programs do not have any access to the shell API when you use os.run (unless you put shell in the environment you pass, but that leads to buggy behavior).

-- shellProgram.lua
print(globalString)
globalString = shell.getRunningProgram())

-- run shellProgram.lua
globalString = "Hello!"
shell.run("shellProgram.lua") -- prints "Hello!"
print(globalString) -- prints "path/to/shellProgram.lua"

So you can a couple of things that shell.run does here. Firstly, when shellProgram.lua asked for getRunningProgram(), shell returned shellProgram, rather than something else. Secondly, they shared a globalString variable because of the shared environment. The following program would not share the globalString variable.

globalVariable = "Hello!"
shell.run("shell shellProgram.lua")
print(globalVariable) -- prints "Hello!"

That spawns another shell which runs the program and does not use the other shell's environment.



#239874 CC 1.75 released!

Posted by ElvishJerricco on 08 December 2015 - 12:37 AM in General

So it's safe for me to revert the changes I made to asm.lua and JVML-JIT to circumvent the bit api problems, right?



#239449 CraftOS 2.0 - Dan's Secret Project

Posted by ElvishJerricco on 01 December 2015 - 12:02 PM in General

View PostCreator, on 30 November 2015 - 06:59 PM, said:

Running it on Java would be slow. Isn't there a C/C++ implementation? I believe it'd be faster.

This is a common misconception about Java. It isn't slow. According to benchmarks, it's actually quite fast. The JIT makes it able to keep up with C in real world applications. Occasionally, Java can even beat C, because of its ability to consolidate optimizations between libraries (optimizations through dynamic linking). Truthfully, it will often be on the wrong side of C, and perform marginally slower. But it's forgivable, and still very fast.

Java's performance problems come in the way of the garbage collector, and programming poorly for it. Minecraft is so much less performant than its Win10 and mobile C/C++/C# (whichever it is) equivalents because those versions have been properly optimized, and aren't destroying a GC. Java Minecraft is written such that it hammers the GC, which slows it down significantly.

That said, I have no evidence to claim whether LuaJ is slower or faster than Lua. That's dependent on how well / poorly LuaJ and Lua are written. I'd have to look at benchmarks.



#237420 Stack trace for CC

Posted by ElvishJerricco on 08 November 2015 - 11:40 AM in Programs

The application being that when xpcall calls your handler, you can use antics with the error function and error levels to generate a stack trace. As Bomb Bloke said, you usually have the debug library to do this cleanly, but we don't have that so we have to cheat.



#237236 CraftOS 2.0 - Dan's Secret Project

Posted by ElvishJerricco on 06 November 2015 - 05:33 PM in General

View PostCreator, on 05 November 2015 - 04:08 PM, said:

How is LuaC related to LuaJIT?

It's sort of not. LuaJIT is its own separate project. It's just also written in C (and this DynASM thing the guy made to go along with C).



#237139 CraftOS 2.0 - Dan's Secret Project

Posted by ElvishJerricco on 05 November 2015 - 11:52 AM in General

View Postdan200, on 05 November 2015 - 11:07 AM, said:

Thanks for the info, I think my overhaul covers everything needed. CC already supports postdata though!

I may have missed something, but I'm surprised no one has mentioned binary HTTP handles. Maybe this isn't irrelevant in CraftOS 2, but the issue with binary strings and undesired automatic unicode conversion makes getting binary data with HTTP literally impossible. It's been mentioned multiple times in the suggestions forum. Either binary HTTP or a fix to the string bug would be amazing.



#235098 Programming Language JaC - Compiler

Posted by ElvishJerricco on 11 October 2015 - 11:01 PM in Programs

View PostCreator, on 11 October 2015 - 09:25 PM, said:

Impressed by what?
What are lambdas?

Making a language is impressive. I've made a few and it's always really interesting. This language is useful because packages encapsulate your code, and in-language classes serve as an infinitely more elegant solution to OOP than the hacky, manual, strange OOP system you have to construct in ordinary Lua. Yes all of this is possible in Lua, but it's clunky and annoying in Lua.

Lambdas are anonymous functions.

doSomethingWithCallback(function() ... end) -- pass a lambda as a parameter

Anyway, about this project: It looks really good. Is it possible to use the "using" syntax to import packages from other files? Also, I took a look at your parser. You might want to do some reading on abstract syntax trees (ASTs) and their construction. It makes defining the language a lot easier and eliminates potential bugs.



#235094 [MC 1.8.9-1.11.2] CC Tweaks

Posted by ElvishJerricco on 11 October 2015 - 10:38 PM in Peripherals and Turtle Upgrades

View PostSquidDev, on 11 October 2015 - 11:49 AM, said:

Should have explained. The fs API is the only one I haven't patched, partially because it is the most work, and partially because binary mode exists already. There isn't 'one size fits all' solution to the string bug so I've rewritten the relevant bits of most APIs (http, os.queueEvent, rednet) to support binary transfer. If people want it, I'll also patch the fs API but I left it as is for this release.

TLDR:
Everything works but fs.

Couldn't you patch the LuaJ string conversion methods to fix everything?



#235092 CraftOS 2.0 - Dan's Secret Project

Posted by ElvishJerricco on 11 October 2015 - 10:36 PM in General

View PostLyqyd, on 11 October 2015 - 06:15 PM, said:

I just hope the default shell will have support for I/O redirecting (pipes!). The io API would be a sensible way to do this.

This would be wonderful. ClamShell just overwrites the global print and write functions.

View PostCreator, on 11 October 2015 - 07:05 PM, said:

I just saw an os.pullEvent in the video meaning that it will be event driven, which is rather sad because almost no programming language works like this.

At the very least I hope there will be no 10 sec limit.

I think the only problem with the event driven architecture is the terminate event. It really throws the whole system for a loop.



#234884 [MC 1.8.9-1.11.2] CC Tweaks

Posted by ElvishJerricco on 10 October 2015 - 09:53 PM in Peripherals and Turtle Upgrades

View Postjustync7, on 10 October 2015 - 08:32 PM, said:

What is this "String Bug" you speak of?

To elaborate, binary data can't be represented in String form when converting between Java and Lua, because LuaJ treats all binary data as Unicode. This mangles the data supposedly irreparably. So the HTTP api (which only returns strings) can't be used to download binary files such as zip files.



#234860 CraftOS 2.0 - Dan's Secret Project

Posted by ElvishJerricco on 10 October 2015 - 08:13 PM in General

View PostLignum, on 10 October 2015 - 03:53 PM, said:

Spoiler
What's that at the border? It doesn't look like Minecraft, so it's probably standalone...
It's around 1:02 in the video, for reference.

That looks like the OS X Yosemite default background. Definitely a desktop application



#234735 CraftOS 2.0 - Dan's Secret Project

Posted by ElvishJerricco on 10 October 2015 - 02:23 AM in General

View PostBomb Bloke, on 10 October 2015 - 02:03 AM, said:

Mind you, you never did strip out those sleep(0)'s...

Lol yea but they're not the cause. They're only occurring once every 2 or 3 seconds, which means there's still 2 to 3 seconds of processing in between.



#234733 CraftOS 2.0 - Dan's Secret Project

Posted by ElvishJerricco on 10 October 2015 - 01:57 AM in General

View PostBomb Bloke, on 10 October 2015 - 01:35 AM, said:

I'd be rather more inclined to assume he just used his "real" system interface to dump the zip there, then to extract it to the folder. But who knows? I guess I wouldn't be surprised either way. Java, for example, has zip capabilities built into its standard libraries.

There's nothing stopping coders from implementing a Lua zip compressor for ComputerCraft, though. Yeah, Lua isn't the most efficient language for the job, but by no means does that mean we aren't "able" to do it. From where I'm sitting, there just hasn't been much in the way of a point.

Within ComputerCraft, once you've compressed a file up you've gotta deal with the UTF-mangling that applies to any attempts to transmit the thing into / out of your Minecraft server. My Package script deals with that via base64, but it also applies LZW compression while it's at it, so there still isn't terribly much point in furthermore applying zip (that I can see, at least).

Yea Grin uses Base64 and Zip with DEFLATE compression. It's... Cumbersome. The performance implications with the way CC does everything are pretty bad.



#234727 CraftOS 2.0 - Dan's Secret Project

Posted by ElvishJerricco on 09 October 2015 - 11:38 PM in General

View PostBomb Bloke, on 09 October 2015 - 09:38 PM, said:

View Postapemanzilla, on 09 October 2015 - 09:11 PM, said:

Zip archives! (.zip file visible in the screencap) I'm guessing that this means that he has implemented a way for us to use zip archives, which will be pretty neat!

We can do that now (eg, ElvishJerricco implemented this module into GrinGet).

Although admittedly that is a very bad implementation, as it relies on loading the entire zip into memory, since we can't do file seeking.



#232914 [CC1.74] Bit api bugs

Posted by ElvishJerricco on 19 September 2015 - 07:55 PM in Bugs

Doesn't seem to have a distinction between logical and arithmetic shift.

I didn't even manage to convert everything to the new bit library. Just anything that could have been vulnerable. It'd be great if you could go through asm.lua and JVML-JIT and see about improving the bit stuff.

Although honestly, the emit time didn't go up at all with the adoption of the pure lua one.



#232856 JVML-JIT - Java Virtual Machine in Lua, with JIT Compiler.

Posted by ElvishJerricco on 19 September 2015 - 04:56 AM in Programs

0.5.3 released. Should resolve the issue where nothing would run on CC 1.74.



#232849 [CC1.74] Bit api bugs

Posted by ElvishJerricco on 19 September 2015 - 03:56 AM in Bugs

This bug has broken asm.lua and subsequently JVML-JIT, and now I have to find a different, pure Lua (and therefore slow) bit API. Anyone have any suggestions?



#232261 Stack trace for CC

Posted by ElvishJerricco on 11 September 2015 - 06:26 AM in Programs

Hm. Didn't realize we had access to xpcall. I just always assumed it was disabled. Glad I'm wrong. Wonderful utility!