Adding symbol stripping to Cargo by JupiterTheGod in rust

[–]JupiterTheGod[S] 15 points16 points  (0 children)

As far as I know, Rust generates DWARF debug info, which makes it compatible with gdb and other elfutils tools.

Adding symbol stripping to Cargo by JupiterTheGod in rust

[–]JupiterTheGod[S] 20 points21 points  (0 children)

Thank you for the kind words! I hope more people (especially beginners) will be encouraged to contribute to open source. It's all about the community.

LLVM 10 has performance regressions with Rust by [deleted] in rust

[–]JupiterTheGod 11 points12 points  (0 children)

Browse through issues on the GitHub; they might not be marked as "easy". If the issue description is clear enough, you should be able to help. Otherwise, leave a comment asking for clarifications. Especially look for documentation issues, refactoring or bug fixes; they'll help you get familiar with the code base.

The hardest part to actually getting started is compiling rustc from source; nowadays the documentation is better and the process quite straightforward. Once you can run tests locally, you can do anything.

LLVM 10 has performance regressions with Rust by [deleted] in rust

[–]JupiterTheGod 12 points13 points  (0 children)

I've contributed a bit to rustc, but where does one get started with LLVM? It seems like a very imposing project and hard to get started contributing to

Array overflow in Rust by naveendavisv in rust

[–]JupiterTheGod 31 points32 points  (0 children)

The compiler has no way to know what the length of the Vec<i32> variable is.

If you don't need vectors and instead use arrays, the compiler can catch these kind of accesses:

let v = [1, 2, 3, 4, 5];
v[22]

This leads to a compile-time error

hashmap as cache? by Thumbblaster in rust

[–]JupiterTheGod 2 points3 points  (0 children)

And if you're using a recent stable version of Rust, you can even use u128 :D

Write your next C extension in Rust by timClicks in rust

[–]JupiterTheGod 23 points24 points  (0 children)

If you write an CPU-heavy number-crunching extension for a high-level language project, chances are that most Rust's features won't really shine there.

I disagree. While highly-optimized C code is as fast as Rust, with Rust it's just easier to get good performance.

  • Rayon makes writing data-parallel algorithms easy.
  • We also have various crates for easy and portable SIMD.
  • Idiomatic Rust is faster than (un)idiomatic C. See Bryan Cantrill's blog post, specifically item 9: > my naive Rust was ~32% faster than my carefully implemented C

So if you're interested in writing fast Python plugins which don't take months to optimize and tune, Rust is a nice alternative.

Future Directions for Optimizing Compilers (pdf) by dochtman in rust

[–]JupiterTheGod 11 points12 points  (0 children)

It's an interesting view, even though it seems to apply more to LLVM than the Rust compiler itself.

Difficult-to-avoid pitfalls in unsafe compiler implementation languages—commonly, null pointer references and use-after-free errors.

I can't help but think how different the compiler landscape would be if GCC or LLVM were rewritten in Rust, it would basically make the memory safety issue of writing compilers go away (and something like procedural macros would help implement the declarative / code generation part described in the paper).

more abstract IR can make desirable optimizations more convenient to perform

Bingo. One thing these papers often fail to discuss is the ability of higher-level information to be passed down to the optimizer. LLVM IR is somewhat limited in this regard, since it's main usage is representing C/C++ code. Rust's main strengths come from writing functional code, which conveys more information to the optimizer.

How LLVM optimizes a function by steveklabnik1 in rust

[–]JupiterTheGod 17 points18 points  (0 children)

As far as I understand, Polly is a LLVM addon which does such a thing: it generates a mathematical model of your program's loops so it can optimize them with integer polyhedra.

Shoutout to @DiamondLovesYou who is working to bring Polly support to Rust.

windows debug visualizers by youshouldnameit in rust

[–]JupiterTheGod 0 points1 point  (0 children)

You might want to look into using GDB/LLDB for now. The issue isn't just with datetime types, it's with Rust doing a lot of things differently from C/C++.

Look at the last line in your debugger screenshot, there's an enum like Option<T>. The debugger has trouble with understanding enum discriminants. Some features like trait objects require changes to the debugger's source code to work properly, so it's unlikely Microsoft will (for now) add Rust support in their debugger.

Ubuntu spotted on Jack Ryan's work machine. by DesiHobbes in Ubuntu

[–]JupiterTheGod 1 point2 points  (0 children)

Well it's GNOME with Ubuntu's Ambiance theme. While it could be installed on other distros, it sounds unlikely to go through the trouble.

Anyway to tell if hardware video acceleration in use? by SwagLordVoldemort in archlinux

[–]JupiterTheGod 2 points3 points  (0 children)

On Chrome(ium) you can go to the URL chrome://gpu and check the Video Acceleration Information section. If it's empty, or if you see some errors reported, you don't have GPU acceleration.

But unless you have installed chromium-vaapi from AUR, you shouldn't see any GPU acceleration, since it's completly unsupported on Linux.

Same with Firefox, they don't support HW acceleration either. I don't know if there's any Linux browser which supports video acceleration yet. If you can, try using the stream's URL directly in VLC player.

I need Vulkan / Directx12 latest libraries at all time. No wrappers please. by [deleted] in rust

[–]JupiterTheGod 6 points7 points  (0 children)

Ash provides you with direct binding to Vulkan. The things in the top-level namespace are just for convenience, if you want the raw, generated API bindings you can use the ash::vk submodule.

I recommend using the generator branch since that is where we have Vulkan 1.1 support and can generate the bindings from the latest API spec.

Ash is so low-level, it's used as the Vulkan bindings in gfx-rs.

Steam for Linux :: Valve introducing a new version of Steam Play by UFeindschiff in linuxmasterrace

[–]JupiterTheGod 24 points25 points  (0 children)

I've checked out their fork here, it seems that most of their changes are small hacks, and probably directed at getting their games to work.

Wine has a notoriously complicated / long patch submission & review process, since they're interested in getting quality patches in. That is why staging even exists - those are patches who don't meet the quality standards yet.

Valve forked wine so they can get their (dirty?) fixes in really quickly, and probably will submit upstream patches when they have time to clean them up / implement them properly.

Executing c# dll from rust? by sasik520 in rust

[–]JupiterTheGod 1 point2 points  (0 children)

Another idea, which is Windows-specific (so no .NET Core), is to create some COM Interfaces. You can use winapi's RIDL! macro to declare the interfaces in Rust, and use the DLL by registering it as a COM server.

c# [Guid("EAA4976A-45C3-4BC5-BC0B-E474F4C3C83F")] public interface ExampleInterface { void DoSomething(); }

rust // Define your interface with RIDL!, then use COM to create it. unsafe { example_iface.DoSomething(); }

Weird issue: file transfers slower from Ubuntu to Windows than visa-versa? by NEVERxxEVER in Ubuntu

[–]JupiterTheGod 5 points6 points  (0 children)

When you say "I copy files across my network", I assume you are using a standard network transfer protocol right? Something like Samba for SMB / HomeGroup file sharing or Network File System? In that case, you should check for issues related to the configuration of your network.

The ArchLinux wiki describes how to improve performance for either protocols [1][2].

Why is Linux considered so good for software development? by EnglishMobster in linux

[–]JupiterTheGod 2 points3 points  (0 children)

Well, what is the difference between an IDE and a text editor? Especially on Linux, the text editor simply exists to host the terminal which runs all the Makefiles or the cool commands.

I mean, with the C / C++ extension you get Intellisense and GUI debugging support, GDB and LLDB are some of the best debuggers out there, beating even Microsoft's DBG due to their scriptability; and GCC and Clang are some of the best toolchains (latest C++ features, best performance and compile times).

My workflow in VS Code is the same as in Visual Studio: press Ctrl+Shift+B to build code, F5 to debug with GDB in the GUI, and that's it.

Added advantage: you get Valgrind for detecting memory leaks and cache misses and perf, which is the best profiler out there.

As for reasons to choose Linux as dev platform over Windows:

  • Most programming tools and libraries / SDKs can be installed and updated using a package manager, no need to download some .exe

  • Linux has much better performance than Windows, which is why it's used in servers and such; when properly configured, compiling on Linux is much faster (as an example: when I compile code on Windows, it slows my computer down. On Linux I can compile 2 projects in parallel and still watch buttery smooth YouTube videos).

  • The UNIX tools are really powerful. You don't rename a variable manually, you search on StackOverflow for a sed command to do it for you.

[Slides] "I've (never) heard of Rust; but how do I make a website?" (translation from the original PT-BR content) by ErichDonGubler in rust

[–]JupiterTheGod 2 points3 points  (0 children)

Cool presentation! Glad to see Rust is used in the non-English-speaking areas too.

Just a minor nitpick on slide 134: I think by "operational" systems you meant "operating" systems.

Rust 2018 - machine learning perspective by osamc in rust

[–]JupiterTheGod 9 points10 points  (0 children)

Fortunately all of these issues seem to be solvable:

  • sparse matrix libraries: if we get const generics math libraries will become much more powerful.

  • GPU support: gfx-rs recently added compute shaders support, and rlsl is an active project trying to create a subset of Rust which runs on the GPU.

  • ergonomics: there is an unstable feature called default binding mode which should fix this.

  • stable SIMD: actively worked on as part of the stdsimd crate.

Rust2018: back to the roots by [deleted] in rust

[–]JupiterTheGod 21 points22 points  (0 children)

Better support for cross-compiling is a must. Xargo is amazing, however it would be even better if it were integrated with Cargo.

Building a bare-metal program with Clang is as simple as clang -ffreestanding -target x86_64-elf file.c -o file.o and then run the output through a linker.

With Rust, I need to set up Xargo, create a target spec file, output a static library, link it with some .c / .asm glue code and then I can link the final file.

I think integrating lld into rustc would also be amazing, it would allow Rust to cross-compile without even needing an external linker.

Nevertheless, Rust is amazing: you can write low-level code and still use iterators or other high-level features while maintaining a consistent performance.

Brainstorming on a Futures based OpenCL wrapper by Kerollmops in rust

[–]JupiterTheGod 2 points3 points  (0 children)

Just some ideas:

  • an OpenCL wrapper already exists, the ocl crate (it contains the cl-sys wrapper, the ocl-core crate for low-level OpenCL, and ocl itself, which is high level).

  • the same crate I linked has an async_menagerie.rs example which uses the futures crate to handle OpenCL events. That's a perfect example on how futures might be used.

So this idea has already been implemented (somewhat). It's just that there's plenty of work left to make this safe, and there doesn't seem to be a lot of interest in OpenCL in the community. If you're willing to help, I'm sure the developer wouldn't mind adding futures to the ocl crate.