Threads for pyk

  1. 1

    I’m using Notion with their education plan. So far the experience is good.

    1. 1

      Is the template approach works on older browser?

      1. 4

        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.

        1. 2

          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?

          1. 13

            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.

            1. 2

              Ah okay, thanks 👍🏻

              1. 1

                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.

                1. 6

                  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.

                  1. 2

                    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.

            1. 2

              Thanks for the post. Just to add one bullet point that I think it is important in 1:1 part:

              • Understand the people who you are talking to. Espescially if you are working multi-cultural/racial team.
              1. 1

                Hey thanks for reading the post and your reply! I will add the bullet later today, with proper attribution of course :)

              1. 4

                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).

                1. 3

                  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?

                  1. 1

                    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!

                    1. 1

                      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)

                  2. 1

                    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.

                    Thanks!

                  1. 4

                    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.

                    1. 2

                      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 :)

                      1. 1

                        The https is broken on the chrome mobile (iOS 10)

                        1. 4

                          @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.

                          1. 1

                            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.

                            1. 2

                              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?

                              1. 10

                                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.

                                1. 6

                                  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.

                                  1. 4

                                    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.

                                  1. 1

                                    I think it would be better to also plot the benchmark results. It will make easier to read & compare the results

                                    1. 3

                                      Actually, I’ve heard there are an infinity of them.

                                      Can you prove that?

                                      Don’t have to. Axiom of infinity. :)

                                      This thread made my day :))

                                      1. 1
                                        • 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

                                        1. 1

                                          wondering how xmake handle third-party libraries and internal module for c project. I think the combination of xmake and clib is a double win :)

                                          1. 3

                                            xmake can integrate local packages automatically now.

                                            .e.g

                                            add_packagedirs("pkg") 
                                            target("demo")
                                                add_package("sqlite3", "openssl")
                                            

                                            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. : )

                                          1. 3

                                            wow! happy birthday lobster.rs!

                                            1. 11

                                              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.

                                              1. 2

                                                Read any good sci-fi novels recently?

                                                1. 8

                                                  Not the OP but wanted to mention Seveneves - I really enjoyed it.

                                                  1. 2

                                                    Added to my “to-read” pile.Thanks.

                                                    1. 2

                                                      Yes!!! I just finished this - I liked it a lot but not as much as Snow Crash, still a fantastic novel.

                                                      1. 2

                                                        I started this a week ago! Really enjoying it :)

                                                        1. 1

                                                          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!” :)

                                                        2. 4

                                                          The Metamorphosis of Prime Intellect
                                                          The Martian

                                                          1. 5

                                                            +1 for The Martian

                                                            1. 2

                                                              +1 for The Metamorphosis of Prime Intellect

                                                            2. 3

                                                              Diaspora by Greg Egan always tops my list.

                                                              1. 1

                                                                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.

                                                                1. 3

                                                                  Reading up on Stanislaw Lem. Foundation was awesome, but Lem… Summa Technologiae should be taught in schools!

                                                                  1. 1

                                                                    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.

                                                            1. 1

                                                              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.

                                                              1. 2

                                                                At work:

                                                                • Working on some requested feature for the search infrastructure
                                                                • Word embedding with word2vec, trying to cluster a words from customer’s chat, reviews, etc. We will use this for another Machine Learning task.

                                                                Personal:

                                                                • Balancing work, school and life. (It’s hard but it’s possible)
                                                                • Have fun with TensorFlow
                                                                • Preparing exam