-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite in rust(🚀)? #3
Comments
Can rust print hello world? because its so hard in c and I would switch to rust if we can do that |
@gek169 how???????????? |
@mTvare6 README.rst???? |
Of course, hello world in rust(:rocket:) could even benefit from:
|
|
yes, this program does that to convert all c binds to magic rust safety program object file thing which is very safe to run and is blazing fast |
it is easy to print hello world in rust, just enter the following code and run it
|
Because Rust(🚀) is BLAZING 🚀 fast and so is it's community (🚀). This means we stay on top of bugs 🐜, feature ✨ requests, and issues ❌. We don't let bugs 🐜, feature ✨ requests, and issues ❌ go to waste. Though, Rust(🚀) has no issues, so we just stay on top of bugs 🐜 and feature ✨ requests. |
That being said, we need a Rust(🚀) interpreter written in Rust(🚀) in order to rewrite this in Rust(🚀). |
rust-lang/rust: (slient) |
That is not ❌ written ✍️ in Rust(🚀). It seems to use 🤢 Python 🐍... |
👀
Rust(🚀) is blazing 🚀 fast, but the python 🐍 should 💎 be ported 📡 to Rust(🚀) for max 💯 performance ⭐ |
|
This code does not compile 👎 due to missing closing double quote 🙁 and thus merely serves as proof of the need for a truly minimal, robust Hello World application with guaranteed memory safety 🚀 |
In C writing of "Hello, World" is also easy! Create .c file with any name, then save to it this: #include <stdio.h>
int main()
{
puts("Hello, world!");
return 0;
} and then run: |
c++ user detected??!?!?!??! wtf wtf wtf wtf smh |
иди нахуй |
C лучший |
I don't think it's as easy as rust version, anyway it seems to segfault on my toaster running arch |
Not memory safe =| |
there are just nothing to cause segfault |
I believe that if you include the right headers then your can make your C code safe and reliable. That said, below is an industry-standard well-established piece of code to illustrate what I'm saying. // SAFETY?: You **must** include the right std header down here,
// if you don't have it then go lazy and use "bindgen" to get one.
// Or even better (safer), include a Rust version of it like "rust_stdio.rs" directly,
// the only downside is that you have to export the whole Rust std into a single file.
// But hey! Rust was thought to be a C/C++ **replacement**
// so it **must** integrate like a charm with cringe C code.
// Do you even think to question that?
#include <rust_stdio.h>
int main()
{
printf("Hello, world!");
return 0;
} P.d. Of course, binary size can vary some MB depending on your target. So at that point, you have to blame LLVM or GCC, at your option. |
Ohhhhh... if we care about memory safety, we shouldn't use printf with one arg #include <rust_stdio.h>
int main()
{
printf("Hello, world!", NULL);
return 0;
} |
Yes, but would this code be blazingly fast(🚀)??? |
Yes |
Let's go to my pseudolanguage #Import "LangBase";
/* connect to rust runtime */
#Set Exec.Lang = Rust;
#Set Compiler.EnableExtensions = { RustSupport, RustMacros };
#Set Compiler.EnableLangFeatures = { Rust.BorrowCheching, Rust.SafetyExtension };
#Set Compiler.DisableLangFeatures = { SKPseudoLang.OOP };
/* import rust std */
#Import "(Rust):std" => std;
#Set Exec.Entry = (Objectless):Main();
@Lang:Rust
_none Main()
{
(RustMacros)println(&"Hello to world of madness!");
}; |
shakalnykot just dropped a C(ringe) |
2: Syntax Error - expected end of linker directive expression:
13 | @Lang:Rust
^
here
Fix: add semicolon:
13 | @Lang:Rust; |
I know. But Rustaceans is more cringe |
Obviously you haven't tried AbleScript. /*Hello, world!*/ print; |
Obviously you haven't tried HQ9+. H |
Not to be confused with h: h |
Why doesn't this look like valid asm format ELF64 executable 3
segment readable executable
define SYS_exit 60
define SYS_write 1
_start:
mov eax, SYS_write
mov edi, 1
mov esi, c
mov edx, clen
syscall
mov eax, SYS_exit
xor edi, edi
syscall
segment readable
c: db "h", 10
clen = $ - c |
x86_64 Linux GAS assembly: .section .text
.global _start
_start:
mov $1, %rax
mov $1, %rdi
mov $str, %rsi
mov $2, %rdx
syscall
mov $60, %rax
xor %edi, %edi
syscall
.section .data
.global str
str:
.byte 'h'
.byte 10
|
x86_64 Linux NASM assembly: BITS 64
segment .text
global _start
_start:
mov eax, 1
mov edi, 1
mov esi, c
mov edx, clen
syscall
mov eax, 60
mov edi, 0
syscall
segment .rodata
c: db "h", 10
clen: equ $ - c |
x86_64 Linux GAS assembly: .section .text
.global _start
_start:
mov $1, %rax
mov $1, %rdi
mov $str, %rsi
mov $2, %rdx
syscall
mov $60, %rax
xor %edi, %edi
syscall
.section .data
.global str
str:
.byte 'h'
.byte 10 |
you already sent that one |
how to install xen hypervisor? |
|
|
thanks, i already installed on my test stand with devuan |
Oh! I was not aware that Xen has already been reimplemented in Rust. |
Rust 🚀 is 🚀🔥🚀🔥 blazingly 🔥🚀🔥 fast 🔥🚀🔥🚀🔥 and 🚀🚀🚀🚀🔥 memory 🚀 efficient 🔥🚀🚀🚀🚀: with no 🚀 runtime 🚀 or 🚀 garbage collector 🔥🚀🚀🔥, it can power 🚀🚀🚀 performance-critical 🚀🔥🚀 services 🚀🔥, run on embedded 🚀 devices 🚀, and easily integrate 🚀🔥 with other languages 🚀. Rust’s 🚀 rich 🚀 type system 🚀 and ownership model 🚀 guarantee 🚀🔥🚀🔥🚀🔥🚀 memory-safety 🔥🚀🔥🚀🔥🚀🔥🚀🔥 and 🚀 thread-safety 🚀 — enabling you to 🚀 eliminate 🚀 many classes of 🚀🚀 bugs 🚀🚀 at 🚀 compile-time 🚀. |
Isn't this already in rust lmao |
💀💀💀 |
Oh right. forgot rust(🚀) was a different language from rust |
This is an awful implementation! It isn't memory safe nor efficient at all! |
Have you considered rewriting this in rust(🚀)?
The text was updated successfully, but these errors were encountered: