HNHacker News
TopNewBestAskShowJobs

swagonomixxx

482 karma · joined December 25, 2016

submissionscomments
swagonomixxx··on Mining Bitcoin with pencil and paper: 0.67 hashes per day (2014)
It's a lockdown. I could see myself spending the weekend doing this.
swagonomixxx··on GameStop Investors Who Bet Big–and Lost Big
I just love how this whole sequence of events is being touted as the "underdog sticking it to the man".

What I see is a bunch of internet trolls getting together and trolling Wall Street.

Is that a bad thing? It depends. If you're just dicking around and you put in an amount you can afford to lose, it's all fun and games. But when you convince newbies to trading and investing to put loads of their hard-earned money, on leverage, to a meme stock, it's not so fun and games anymore, is it?

I'm all for teaching hedge funds a lesson by squeezing them, but it would've been nice if folks come out _mostly_ unharmed financially. Instead, you have lots of these r/WallStreetBets folks in the red on leveraged trades. Good luck making back that money as quickly as you lost it.

swagonomixxx··on Julia 1.6: what has changed since Julia 1.0?
As someone who knows very little but wants to learn: what's the best way to get up and running with Julia? On the website, they link a lot of videos, but I prefer textual formats. Is there something like the Rust Book for Julia?
swagonomixxx··on Julia 1.6: what has changed since Julia 1.0?
For (2), it seems like HTTP.jl [0] is the equivalent.

[0]: https://github.com/JuliaWeb/HTTP.jl

swagonomixxx··on Swift for TensorFlow Shuts Down
> A regular syntax graph of regular Julia code gets manipulated to do autodiff. You are not organizing C++ nodes in a network.

That does sound very different than Python. Admittedly, I haven't used Julia, because I never had to for professional purposes. For personal projects, I use PyTorch, because I find it easy to use, intuitive, and I have a lot of experience with it. Maybe one day I will be forced to use Julia and will appreciate what it brings :)

swagonomixxx··on Swift for TensorFlow Shuts Down
Thanks, I wasn't aware this existed!
swagonomixxx··on Swift for TensorFlow Shuts Down
I am totally with you on statically typed vs. dynamically typed languages _in general_. I'm not denying that there are major advantages to using one for most kinds of programs. But I just don't see a benefit for ML.

You can easily find out if you like it or not, you can use the C++ API for TF/PyTorch and you'll have a statically typed program running your model for you. Sure, it's not Haskell, but C++ is statically typed, and although it's not the most popular or loved language on HN, you can use it to get stuff done.

swagonomixxx··on Swift for TensorFlow Shuts Down
> Most of the community finds python sufficient because they do not need to interleave training and simulating.

That's kind of my point. Most of the community has models running on GPU's and don't care too much about CPU-bound workloads, training or otherwise.

If you do care about that, you are in a relatively small niche of machine learning, statistically speaking. I am not denying it's existence, I'm just saying that your stack will have to be different if you want to extract the maximum level of performance out of your CPU.

> IIRC, a maintainer of a popular project/framework that I contribute saw improvements upwards of 2x when using C++ over python.

That's not surprising at all. Like I mentioned in the parent, if you profiled your code and you found that Python function calls are the main bottleneck, and you believe it to be worth investing time in getting rid of them, you can use the C++ API's of Caffe/TF/PyTorch/Whatever.

I personally don't work in simulations so I haven't ran into your problem. In the deep learning world, the CPU is unusable for any task (training, inference, evaluation, etc.), so I've never been concerned with things like function call overhead.

swagonomixxx··on Swift for TensorFlow Shuts Down
So nobody needs TensorFlow, yet it and PyTorch are pretty much the only frameworks widely adopted for ML, and they're in Python. A quick Google search will tell you that, I don't really feel like rebutting to a baseless statement.
swagonomixxx··on Swift for TensorFlow Shuts Down
> It's definitely not possible. These have to be rewritten with the specific autodiff /ML framework in mind.

I don't understand why it's not possible. You're asking if it's possible in the language. I don't see anything stopping you from, as you say, writing your own framework, or simply doing it in TF. Perhaps my ignorance of Julia is showing :)

swagonomixxx··on Swift for TensorFlow Shuts Down
I'm fairly certain everything you said is possible except for custom CUDA kernels in pure Python. You'd have to write the kernel in C++ and use it in your TensorFlow/PyTorch code. [0][1]

[0]: https://www.tensorflow.org/guide/create_op

[1]: https://pytorch.org/tutorials/advanced/cpp_extension.html

swagonomixxx··on Swift for TensorFlow Shuts Down
Sure, that's fine. But I'm assuming GGP is talking about TensorFlow, since that's what this post is about. If you don't need TensorFlow, then this whole conversation is kinda moot, and you can use whatever you like.
swagonomixxx··on Swift for TensorFlow Shuts Down
Well, there is already Tensorflow.js [0].

[0]: https://www.tensorflow.org/js.

swagonomixxx··on Swift for TensorFlow Shuts Down
> Having a half way decent type system solves so many problems

What problems does it solve for you? When building ML applications I mean. Because that's what S4TF was supposed to be.

ML researchers produce models that are used by ML applications for a particular purpose. The code to train the model _could_ be statically typed, sure, but I really don't see what the improvement would be. It would be more verbose, less readable, have significantly more noise. Just try reading some TensorFlow C++ code equivalents of their Python API.

From the "WhySwiftForTensorFlow.md" document (https://github.com/tensorflow/swift/blob/main/docs/WhySwiftF...):

.. static types: * can catch bugs at compile time instead of runtime. People get very frustrated when a silly type error brings down a long training run hours into it. * directly improve tooling experience like code completion/intellisense, jump to definition, etc. * make it easy to know what operations are Tensor operations.

> can catch bugs at compile time instead of runtime.

OK, but what bugs? For most use cases of TensorFlow that I've seen, if there is a type error somewhere, you will catch it long before it hits production, and if you only catch it 100hr into training, your training code is either non-deterministic or there's some other issue that is not type related. Unless we're talking about dependent types a-la Idris, I don't see how Swift's type system can help catch these kinds of bugs.

> directly improve tooling experience like code completion/intellisense

Sure, but type-hints provide the same improved experience with language servers like PyLance [0]. Not a reason to jump to a new language.

> make it easy to know what operations are Tensor operations.

Easy. Anything that starts with "tf." is a tensor operation.

Yes, I'm being a bit trite, but I was never convinced by the premise of S4TF, because I've never heard an ML researcher or engineer say "static typing will fix my problems".

[0]: https://devblogs.microsoft.com/python/announcing-pylance-fas...

swagonomixxx··on Swift for TensorFlow Shuts Down
It doesn't matter that "Swift is faster than Python". Your TensorFlow graph is gonna be slow as all hell if it's running on the CPU. The bottleneck here really isn't performance on a CPU. That's a no-brainer for all non-ML applications.

But for applications that require a GPU (i.e, most ML applications) cutting over to Swift from Python will likely win you nothing in performance, and wouldn't be worth it at all.

swagonomixxx··on Swift for TensorFlow Shuts Down
> Python has exceptional libraries but, as a language, it's a bit dated on several fronts.

I've been using Python for ML for the last 3 years and I've never felt this way. It might be that I'm not all about the hip new languages, but I don't really see the benefit of making Python more ML/Haskell-ish.

The ML use case for Python is roughly as follows: you design, train, and evaluate models. Then, if something is decent enough to use in production, you switch over your application to load and use that instead. I don't really see where Haskell or any language from the ML family can improve in that process.

Sure, the code that you used to implement your model may improve slightly, but I don't see that code improving significantly. The fruit of your labor is usually a protobuf file (encoding the TensorFlow graph) or whatever your framework uses to encode the model you built. The code actually surrounding it is very minimal for most use cases.

> In Julia, things are really small and composable. For example, you have a probabilistic programming library like Turing and a differentiable programming one like Flux, and it's trivial to implement some Bayesian neural networks.

There's nothing stopping you from composing things in Python. But it's simply not a goal of 99% of ML libraries to be composable with other libraries. You're probably never gonna run TensorFlow and PyTorch in the same application (trust me, I've tried, it was a nightmare) and I don't see why you would compose a TensorFlow model with a PyTorch model without incurring tons of overhead in your application around gluing these two things.

swagonomixxx··on Swift for TensorFlow Shuts Down
I'm not sure I understand what your getting at. If Python's performance in the ML space is not sufficient, then the community would have quickly moved on from it and built something better.

And that something better is certainly not Julia and it's definitely not Swift.

> Yes, I know the heavy lifting is done by C/C++/Rust/Cuda/Blas/Numba and so on, but, when you run simulations for millions of steps, you end up with billions of python function calls.

For ML purposes, if your model isn't running on the GPU, it doesn't matter if you're using Swift, Rust, or whatever, your stuff is gonna be slow. Like it or not, Python is one of the best glue languages out there, and the reason why libraries like TensorFlow and Torch are not used in their native languages (C++) [0] is because they're significantly simpler to use in Python and the performance overhead is usually one function call (e.g run_inference(...)) and not billions.

If you find yourself writing a simulation, and you need to optimize away billions of function calls, you can use the C++ API provided by TensorFlow.

[0] https://www.tensorflow.org/api_docs/cc

swagonomixxx··on Swift for TensorFlow Shuts Down
I mean, I'm fairly certain that this project is the reason Chris Lattner joined Google; it was somehow in his contract somewhere. He just found a way to shoehorn himself in there and make sure that the language that he designed (Swift) is used for something more than just iOS apps. Nothing against him at all, I think most folks would want to push their brainchild as far as they can, but that's just what it looks like from the outside.

Since ML has been a large rage for the last few years, and TensorFlow is one of the most popular frameworks that ML engineers use (although I use and prefer PyTorch) it seemed like the "perfect storm" for Swift to break out of the iOS mold.

But it was clear to me (and many of my peers) that while this was an interesting project, the need for it is really low, and that nobody is going to throw away years of experience with libraries like TensorFlow and PyTorch (via Python) in the trash just so we can use Swift, which for me isn't really that crazy of a language as all the hype makes it out to be, and I'm sure the same is true for many ML devs and researchers alike.

swagonomixxx··on Swift for TensorFlow Shuts Down
Type hints are not perfect, but IMO after using them for a while, they are significantly better than nothing.

If you do the legwork, you can get mypy[0] type-checking done on your codebase in a way that is similar to how TypeScript does type-checking. There are stub files that are provided by project maintainers that are then used by mypy to infer things like e.g the return type of a function.

Type hints are also inline in the code, and not technically comments. They can be retrieved from class attributes using facilities from the standard library [1] and can facilitate other tooling that is specific for your project or that are more general.

> And even then, if you're so thorough with your typing, why not just use a proper statically typed language?

That would remove a lot of the benefit of choosing Python. Python is dynamically typed. Type hints make it possible to do type checking statically, but with a lot of extra leg work (as I described above). Making Python itself statically typed is not something that would interest 99% of the Python community IMO.

[0] http://mypy-lang.org/

[1] https://docs.python.org/3/library/typing.html#typing.get_typ...

swagonomixxx··on Mathematician Solves Sensitivity Conjecture in Two Pages (2019)
I like graph theory a lot (even though my prof in uni was horrible at teaching it). One thing I like about it is at least we can easily visualize most graphs, as opposed to say, n-dimensional spaces from real analysis. I also like that coloring vertices is a thing, and that so many problems can be represented by graphs and we can apply so many graph algorithms on top of those graph representations.

One thing that always makes me laugh though is the terminology in math. Things like "hypercube" just get a chuckle out of me.

I didn't know what the sensitivity conjecture is but your explanation using coloring a graph is very straightforward.

swagonomixxx··on Haskell: The Bad Parts, part 2 (2020)
I'm not sure I understand the relationship between partial function and exception handling. Aren't partial functions just curried? One or more arguments are bound, but not all? At least in Python, if you partial-ify a function that raises an exception, it still raises. I don't understand if the author likes that behavior or doesn't. Maybe this is some Haskell implementation detail that I'm not aware of.

Last time I wrote any non-trivial Haskell was in 2014, so a long time ago, but I found that my biggest problem with it at the time was the really huge variety of Haskell in the wild. If you're doing simple stuff, you probably stick to the prelude and you'll be happy. But if you're doing anything that's a bit complex, you'll end up seeing hundreds of mini-dialects of Haskell in the wild, so much so that I found it really difficult as a newcomer to understand code on the net. In many cases it's almost like a different language completely, what with the user-defined infix functions, tons of currying everywhere, laziness, and the like, made it very difficult to follow code paths.

swagonomixxx··on GitHub experiencing issues with actions, pull requests, packages
I agree with you. To me it just sounds like people being entitled, expecting a service to never go down, ever. Shit happens and things go down. Design your processes around that fact and have procedures lined up for when it does happen.

However, saying "just get GitLab and deploy it to your own server" glosses over the huge time sink it is, especially for small companies that are already short-staffed, to maintain something like that. I sure as heck do not want to be responsible for keeping my GitLab server up.

As you say, if you're writing an issue, put it in an editor issues.md file or something. If you're working on code, even better, just commit locally.

swagonomixxx··on Tesla buys $1.5B in Bitcoin, may accept it as payment in the future
Goods and services will never be priced in BTC because BTC fluctuates by the hour and will probably continue to do so for the foreseeable future. The only way I can see this happening is if you literally eliminate all other currencies, including other cryptocurrencies, because there will always be currencies competing with BTC (and not without good reason).

Classic example of buying a good using BTC: say it costs 100 satoshis. By the time I click and purchase, and by the time the BTC arrives at the seller's address, the value may have changed for the better (BTC price goes down - hence I paid "less") or for the worse (BTC price goes up - hence I paid "more"). For the most extreme example, imagine how people that bought a pizza with Bitcoin when it was worth 5$ feel right now. A 15$ pizza in 2009 or whatever is worth ~150K USD now.

swagonomixxx··on Improving how we deploy GitHub
A place I was at used Hubot as well. It gets the job done, we never really ran into a fuss. Easily extensible as well.
swagonomixxx··on Improving how we deploy GitHub
chatops deploys aren't really new toys, a place I was at was doing them around 2013/14.

We liked it because the chat history you see is essentially a deploy history, no need to login into some other website to check some obscure logs page to see who did what. We did end up having to debug the service that processed the chat messages maybe once, but never ran into an issue when we had to deploy a hotfix.

swagonomixxx··on Tech Preview of Docker Desktop for M1
I don't want to be _too_ pedantic but the M1 macbooks are significantly cheaper than their Intel counterparts. The 13 inch one is around $1300 USD.

But I do agree with you. Cheaper laptops means a worse experience with almost everything.

swagonomixxx··on Serverless vs. Kubernetes – which should you choose?
Easy question - whichever one is hyped more at the particular time you have to make the choice.
swagonomixxx··on EA to buy Dirt Rally-maker Codemasters for £1B
I only recently bought F1 2019 and I am enjoying it - it's quite good when you get used to it.

Shame that EA acquired them.

swagonomixxx··on EA to buy Dirt Rally-maker Codemasters for £1B
This made me chuckle, but I'm now dismayed because I can totally see EA making this some internal KPI ($$$ ripped off per user) that they track the mean, standard deviation, and so on YoY.
swagonomixxx··on GitHub CLI 1.0
It's not utter garbage (at least not yet).
← PreviousPage 3 of 7Next →