This week I’m working on 0xblockchain, it’s a lobsters sister site. Personally, I use this site to collect all post that I read or videos that I watch related to blockchain.
The resulting Rust code is only slightly safer. Some things like array bounds that were not previously checked will be checked. For the most part this translation is just the first step in enabling more substantial refactoring from which the benefits from Rust can start to shine.
Why is the resulting rust code only slightly safer? Rust as a language is a lot more memory safe than C. If you’re talking about current transcompilers, then improving those should lead to improvements in C.
Ah, I’ve misread that. I was referring to Rust -> C compilers which are useful to create if only to understand the domain well enough to bring improvements to C.
I’ve heard that CMake makes complicated builds more easy to manage, but this particular tutorial doesn’t really show that. In fact, it’s actually much less “work” to write a simple Makefile in this case. As such, I left the tutorial with no reason to care about CMake, and instead of a “woah! you knocked my socks off!”, my reaction was, “so what?” But! I’ve been using make for years. For someone new to everything, I think this shows that CMake is easier to reason about. It just wasn’t enough to sway me from my more familiar make.
Criticism aside, I really liked the style of the tutorial, and how the repo is all inclusive. I hope to see more tutorials in the future adopt this style (instead of the typical blog post that isn’t all encompassing without linking out to somewhere else, etc).
As someone who’s used cmake professionally, I agree! It’s a bit simplistic for the basic use-case, with the exception of showing the link capabilities. It also doesn’t mention the other main advantage: once you’ve written the CMakeLists file, you can take it to other systems and (usually)get a clean make system: linux, *BSD, OSX, even Windows(by generating Visual Studio solution files, or Cygwin).
This is also timely: I’ve been keeping a tool/library evaluation repo for a personal project, using cmake to make sure they all work. Would people be interested in this repo if I added docs similar to this tutorial?
This is also timely: I’ve been keeping a tool/library evaluation repo for a personal project, using cmake to make sure they all work. Would people be interested in this repo if I added docs similar to this tutorial?
As such, I left the tutorial with no reason to care about CMake, and instead of a “woah! you knocked my socks off!”, my reaction was, “so what?” But! I’ve been using make for years. For someone new to everything, I think this shows that CMake is easier to reason about. It just wasn’t enough to sway me from my more familiar make.
Yup you are right. My intention was not to convince anyone to use a CMake instead of plain Makefile (or any other tool x), but to helps them to quickly get up and running with CMake if they want to use CMake.
Criticism aside, I really liked the style of the tutorial, and how the repo is all inclusive.
I wouldn’t have wanted it to ask that myself, but we already have people coming from scala contributing and the previous exposure to traits helps a lot.
All the topics that are lamented in the post are seen as first class issues in the Rust ecosystem (which doesn’t mean that are always solved greatly!), we’d be tremendously honored if someone of that skill level would consider contributing.
One major limitation of malloc (and even the best implementations like jemalloc and dlmalloc) is that they try to use a single allocator for each data structure. This is a mistake: A huge performance gain can be had by using a separate allocator for each of your data structures — or rather, for each of your data usage patterns.
I’m interested to read more about this, any link suggestion?
Besides tighter packing, you have better control over object lifetime. If you have a foo and a bar type of equal size, and you alternately allocate a bajillion of each, then free all the foo, that doesn’t really free up any memory for objects of a different size.
I’m interested to read more about this, any link suggestion?
You might also find the memory allocation discussions in Jason Gregory’s Game Engine Architecture interesting. Even if you’re not interested in making games per se, there’s a lot of useful information about memory allocation performance and techniques for doing it very efficiently that apply well beyond the games field.
xmake will suport manage package and dependencies in the next version.
and it will be able to patch and compile third-party libraries for the cross-platform automatically.
: )
Learning and reading about new technology and futurism. Reading science fiction and non-fiction. Hiking. Guitar and other music. Figuring how to increase my value as a human.
Ian M. Banks Consider Phlebas and even better The Player of Games. Both part of the Culture series. This is the ONLY science fiction future society that leaves me saying “Sign me up! I’m there!” :)
Just finished Cat’s Cradle (not obscure but a classic), and now starting on the Foundation trilogy (finally). As stated below, Neil Stephenson’s Seveneves was a veritable page-turner. Also anything by William Gibson.
I tried reading Lem’s Futurological Congress book, but it was just too silly. On the other hand, the Cyberiad somehow hits a sweet spot, it’s one of my favorite books - I made my dad read it to me a lot of times when I was little, and I still really enjoy it.
I’m using Notion with their education plan. So far the experience is good.
Is the template approach works on older browser?
This week I’m working on 0xblockchain, it’s a lobsters sister site. Personally, I use this site to collect all post that I read or videos that I watch related to blockchain.
Cool project 👍🏻. I’m wondering is it “correct” to say that “now we can write safer c” if the C code is transpiled to Rust?
The resulting Rust code is only slightly safer. Some things like array bounds that were not previously checked will be checked. For the most part this translation is just the first step in enabling more substantial refactoring from which the benefits from Rust can start to shine.
Ah okay, thanks 👍🏻
Why is the resulting rust code only slightly safer? Rust as a language is a lot more memory safe than C. If you’re talking about current transcompilers, then improving those should lead to improvements in C.
It’s translating to mostly-unsafe Rust (so does corrode, the other project that does this)
This means you still have the same burden of checking most of the invariants involved.
One use case for tools like these is an easy way to start converting a codebase from C to Rust, doing away with a bunch of the tedium.
Ah, I’ve misread that. I was referring to Rust -> C compilers which are useful to create if only to understand the domain well enough to bring improvements to C.
Thanks for the post. Just to add one bullet point that I think it is important in 1:1 part:
Hey thanks for reading the post and your reply! I will add the bullet later today, with proper attribution of course :)
I’ve heard that CMake makes complicated builds more easy to manage, but this particular tutorial doesn’t really show that. In fact, it’s actually much less “work” to write a simple Makefile in this case. As such, I left the tutorial with no reason to care about CMake, and instead of a “woah! you knocked my socks off!”, my reaction was, “so what?” But! I’ve been using make for years. For someone new to everything, I think this shows that CMake is easier to reason about. It just wasn’t enough to sway me from my more familiar make.
Criticism aside, I really liked the style of the tutorial, and how the repo is all inclusive. I hope to see more tutorials in the future adopt this style (instead of the typical blog post that isn’t all encompassing without linking out to somewhere else, etc).
As someone who’s used cmake professionally, I agree! It’s a bit simplistic for the basic use-case, with the exception of showing the link capabilities. It also doesn’t mention the other main advantage: once you’ve written the CMakeLists file, you can take it to other systems and (usually)get a clean make system: linux, *BSD, OSX, even Windows(by generating Visual Studio solution files, or Cygwin).
This is also timely: I’ve been keeping a tool/library evaluation repo for a personal project, using cmake to make sure they all work. Would people be interested in this repo if I added docs similar to this tutorial?
Yes, absolutely!
Ok, I’ll clean it out and see if I can get it up in the next few days.
(Also, I’d like to echo apg’s compliments on the style of the tutorial: it is a good introduction for people totally unfamiliar with CMake)
https://lobste.rs/s/mgb0bi/collection_cmake_recipes
Yup you are right. My intention was not to convince anyone to use a CMake instead of plain
Makefile
(or any other toolx
), but to helps them to quickly get up and running with CMake if they want to use CMake.Thanks!
work: Continue my work to port HRAN theano to tensorflow.
personal: Re-reading the Rust book. I’m on chapter 4, and it’s been awesome experience.
Useful tool, I would like to replace my ls(1) even without git support. Why I use exa git support when I can simply running a git status :)
The https is broken on the chrome mobile (iOS 10)
@soc Sorry to hear that. What’s your plan for the next? are you considering to contribute to other prog-lang’s community? such as Go/Rust etc.
I wouldn’t have wanted it to ask that myself, but we already have people coming from scala contributing and the previous exposure to traits helps a lot.
All the topics that are lamented in the post are seen as first class issues in the Rust ecosystem (which doesn’t mean that are always solved greatly!), we’d be tremendously honored if someone of that skill level would consider contributing.
Rust.
I’m interested to read more about this, any link suggestion?
http://paperswelove.org/2015/video/ryan-zezeski-memory-by-the-slab/
Long story short - if you know how large the type is, you can make a lot of assumptions that reduce fragmentation.
Besides tighter packing, you have better control over object lifetime. If you have a foo and a bar type of equal size, and you alternately allocate a bajillion of each, then free all the foo, that doesn’t really free up any memory for objects of a different size.
You might also find the memory allocation discussions in Jason Gregory’s Game Engine Architecture interesting. Even if you’re not interested in making games per se, there’s a lot of useful information about memory allocation performance and techniques for doing it very efficiently that apply well beyond the games field.
I think it would be better to also plot the benchmark results. It will make easier to read & compare the results
This thread made my day :))
Job: Fixing bugs for our search infra, add new features, especially an implicit filter for category
Hobby: This week I’m creating a Python interface for Facebook fastText
wondering how
xmake
handle third-party libraries and internal module forc
project. I think the combination ofxmake
and clib is a double win :)xmake can integrate local packages automatically now.
.e.g
You can refer to https://github.com/waruqi/tbox/blob/master/src/tbox/xmake.lua and the packges https://github.com/waruqi/tbox/tree/master/pkg
xmake will suport manage package and dependencies in the next version. and it will be able to patch and compile third-party libraries for the cross-platform automatically. : )
wow! happy birthday lobster.rs!
Learning and reading about new technology and futurism. Reading science fiction and non-fiction. Hiking. Guitar and other music. Figuring how to increase my value as a human.
Read any good sci-fi novels recently?
Not the OP but wanted to mention Seveneves - I really enjoyed it.
Added to my “to-read” pile.Thanks.
Yes!!! I just finished this - I liked it a lot but not as much as Snow Crash, still a fantastic novel.
I started this a week ago! Really enjoying it :)
Ian M. Banks Consider Phlebas and even better The Player of Games. Both part of the Culture series. This is the ONLY science fiction future society that leaves me saying “Sign me up! I’m there!” :)
The Metamorphosis of Prime Intellect
The Martian
+1 for The Martian
+1 for The Metamorphosis of Prime Intellect
Diaspora by Greg Egan always tops my list.
Just finished Cat’s Cradle (not obscure but a classic), and now starting on the Foundation trilogy (finally). As stated below, Neil Stephenson’s Seveneves was a veritable page-turner. Also anything by William Gibson.
Reading up on Stanislaw Lem. Foundation was awesome, but Lem… Summa Technologiae should be taught in schools!
I tried reading Lem’s Futurological Congress book, but it was just too silly. On the other hand, the Cyberiad somehow hits a sweet spot, it’s one of my favorite books - I made my dad read it to me a lot of times when I was little, and I still really enjoy it.
Github: network effect is a real, I create github account to share my package/library. For private project I prefer to use gitlab.
Gmail: State-of-the-art spam filtering for free. I use gmail because of the simplicity and easy to use.
Slack: Team communication done right. I can use slack on iphone or macbook which help me keep up to date on my team while on mobile.
At work:
Personal: