Badges
Activity Feed
Commented to thread : Introducing LUNIR, the Lua IR
Check my latest reply for an explanation on the answer to this.
Replied to thread : Introducing LUNIR, the Lua IR
Okay everyone, I've seen the answers so far and none of them are necessarily wrong, but they're all not entirely accurate.
The fact is, most people think that if a <= 0 is true, then a >= 1 can not be true. There is a case, however, where both of these expressions are true and both if statements run through.
The issue is that everyone automatically assume that `a` is a number because it's being compared with a number, that's not true, honestly we have no clue what `foo` returns. `foo` could return a type that has a metatable with overloaded __ge and __le, then both of them can be true.
The answer is that we can't optimize anything here, not without knowing what foo returns and being sure we know what type `a` is.
Created a new thread : Introducing LUNIR, the Lua IR
Hello everyone, you might or might not know me from my past presence on this forum.
Today I'm making a thread about a large scale project that I'm working on, and I'm looking for contributors, this can benefit any and all people using Lua.
LUNIR is a project that I started with a few friends, its an acronym for Lua Universal Intermediate Representation, and a play on words for Lunar.
What is LUNIR?
LUNIR is an open source intermediate representation for Lua source code and bytecode.
It can represent Lua 5.x (5.0 to 5.4) & Luau bytecode or source code
It's an intermediate for all relevant Lua versions that employs optimization and analysis at both the high and low level.
What can it do?
LUNIR has a wide range of application, it's generalization allows it to be very complex and useful in many scenarios.
Typically, when thinking of intermediate representations, you think of compilers, and while that applies to LUNIR, its scope is far larger.
You can use LUNIR to write a
- compiler
- decompiler
- optimizer
- formatter
- linter
- obfuscator
- deobfuscator
- transpiler
(the transpiler part applies at the bytecode & source levels)
How do I use it?
Unfortunately, LUNIR is not stable.
The issue is that this project is very large and complex, myself and the 2-3 other contributors are simply not enough.
That is why I'm coming to this forum to recruit anyone that thinks this project would be useful to them.
If you're still interested, keep reading, here's how you can contribute to the development of something great.
Contributing
First, the project is written exclusively in Rust, if you don't know Rust that's okay, don't let that scare you away, your input is still important.
Not sure if you have what it takes? That's okay.
For anyone willing to contribute to the project, I have a simple test that you can take a shot at.
There's no wrong answers here, post your thoughts in a reply to this thread if you want to try it, and in ~2 days I'll update the thread with the answer.
If you don't feel like waiting for that, post your answer then send me a DM and I'll tell you what the answer is.
------------------------------------------------------------------------------------------------------------
If you were an optimizing compiler, would you optimize anything in this code? If so, what would you optimize?
local a = foo()
if a <= 0 then
if a >= 1 then
print("a")
end
print("b")
end
Commented to thread : (Probably annoying by now) std::cout or std::printf?
@TERIHAX System is used to invoke any shell command so the safety of it depends on how it's invoked.
Besides that though, system is a pretty slow function and using it to clear the screen is very slow, there are specific terminal codes dedicated to clearing the screen that are far better suited for it.
Replied to thread : (Probably annoying by now) std::cout or std::printf?
std::cout is safe whilst printf may not be.
printf uses C runtime formatting which is notorious for causing some of the biggest bugs in history and causing billions of dollars in damage, outputting a string in printf is dangerous, whilst formatting them through a stream is not.
Commented to thread : My Programming language rating list
bro you suck at programming shut up I'm awesome you aren't
Commented to thread : My Programming language rating list
oh you think rust is overrated? that just means you're retarded and can't code.
Replied to thread : My Programming language rating list
Though I believe some of these languages could be moved up, overall Rust is the greatest programming language.
Anyone that disagrees can debate me on it.
Replied to thread : NEWS | Roblox has moved the second roblox directly in the main process
@Astronemi, That just isn't how byfron works, it has nothing to do with the game using Lua
Replied to thread : Rust Best Practices 1 — Case, Enums, and Argument Flexibility
Wonderful thread, thanks for educating people on better Rust practices.
Hope this thread inspires some new programmers to try Rust or at least check it out.
Replied to thread : Beginning my road with C++ and Reverse Engineering
@atariXD, Through extensive experimentation with the Rust programming language, I have determined that surreptitiously embedding illicit functionality within a legitimate program is not advisable. However, crafting an entirely separate unscrupulous application in Rust operates sublimely and without issue.
Replied to thread : State which phrase is blacklisted
@matty324, my friend has a thread with 0 profanity that is being flagged, it'd be nice to know what the issue is.
Created a new thread : State which phrase is blacklisted
When you write a giant thread, go to post it, then see "Contains a blacklisted phrase" it's quite annoying because it doesn't tell you which blacklisted phrase was used.
Replied to thread : Screw Electron. Check out Tauri (Rust over Node.js)
Tauri is a great alternative I agree, the memory usage on it is so low as well.