HNHacker News
TopNewBestAskShowJobs

cosmic_quanta

1,529 karma · joined November 22, 2017

To learn more about me, visit https://laurentrdc.xyz
submissionscomments
cosmic_quanta··on Solar Generation Surge Sends European Power Prices Below Zero
Electricity markets are completely inelastic in the absence of storage ability. Negative prices are an indication that the grid needs the ability to absorb surpluses from sources with effectively free fuel (solar, wind).

Note that "absorbing surpluses" does NOT require energy storage in the form of batteries, which is expensive and not necessarily green. Another option is grid-interactive buildings, that can harness energy surpluses in near-real-time when they arise [0]. Hopefully we seem more of these buildings.

[0]: https://edoenergy.com/

cosmic_quanta··on The PhD Metagame: Don't try to reform science – not yet
Best of luck (not being sarcastic). Hacker News celebrates the risk-taking of startups for a reason -- great leaps often requires taking a risky jump. What you're doing is similar.

Please post about your experience! I'l love to read what happened

cosmic_quanta··on The New York Stock Exchange plans to launch NYSE Texas
Chicago remains the hub for commodities
cosmic_quanta··on Montreal has dropped Amazon from its list of suppliers, pledges to buy local
While tariffs are on everyone's mind, the key reason is:

> Amazon critics are also calling for a boycott following the closure of seven warehouses in Quebec

Amazon warehouses in the provice had started unionizing. Incredible coincidence.

cosmic_quanta··on Ask HN: Tools you have made for yourself?
I created a Pandoc filter to render some code blocks into figures for my PhD thesis. This is nice because one does not have to manage text and figures separately.

https://github.com/LaurentRDC/pandoc-plot

cosmic_quanta··on You could have invented Fenwick trees
I always feel warm inside when I hear of concepts in separate fields connecting in some way. Very cool
cosmic_quanta··on Why is homeschooling becoming fashionable?
I'd love to read about your experience doing this!
cosmic_quanta··on Misty: A secure distributed actor language
> The Misty Programming Language is a dynamic, (...), secure, distributed actor language

In this day-and-age, dynamic programs should be considered insecure (in the broad sense) by design. There have been lots of efforts in the past ~15 years to make distributed systems more robust (e.g. Cloud Haskell [0], choreographic programming [1]).

The term "secure" as used here is quite specific, used in reference to a capability model. This is quite nice and innovative. However, static typing and capabilities need not be mutually exclusive: capabilities can be modeled at the type level using algebraic effects [2].

[0]: https://simon.peytonjones.org/haskell-cloud/

[1]: https://en.wikipedia.org/wiki/Choreographic_programming

[2]: https://github.com/yallop/effects-bibliography

cosmic_quanta··on Ingrid Daubechies awarded National Medal of Science
This award is well-deserved!

I was inspired by her work in the 2010s and have since used the wavelets to denoise time-series with great success [0]. I believe that learning about wavelet transforms is both beneficial in itself, but also beneficial in understand the ubiquitous Fourier transform.

[0]: https://laurentrdc.xyz/posts/wavelet-filtering.html

cosmic_quanta··on NYC Congestion Pricing Tracker
The thing about congestion is that reducing the number of drivers slightly (e.g. 10-20%) could eliminate congestion by 100%! This is the same way it works for electrical congestion.

So you need pricing which will make a few people reconsider driving, who were on the edge of using public transit anyway.

cosmic_quanta··on Property-Based Testing for the People
This work was discussed by the author in the Haskell Interlude podcast as well [0]. Highly recommended and probably easier to digest than a whole dissertation.

[0]: https://haskell.foundation/podcast/59/

cosmic_quanta··on Ask HN: Who wants to be hired? (January 2025)
Edit: I have accepted a new job offer. Thanks HN!

---------

Location: Montréal, Canada

Remote: Yes, I can do remote, but prefer on-site when possible

Willing to relocate: Yes. I speak French and English. Easy to get visa for the US, Europe, and Commonwealth countries (NZ, UK, Aus, etc)

Technologies: Haskell, Python, Rust (been a while though), MATLAB, C, C++, MySQL, PostgreSQL, TimescaleDB, Git, GitHub Actions, machine-learning, distributed systems, operations research, PyData stack (numpy, scipy, pandas, ...), GPU programming, Qt, computer vision. Anything not listed can be learned

Résumé/CV: On request -- all details at https://laurentrdc.xyz/about

Email: laurent `dot` decotret `at` outlook `dot` com

---------

I am a physicist with lots of software experience in many domains, including scientific computing, distributed systems, finance & trading, machine learning, and power grid infrastructure.

I maintain several free and open-source software packages, including Cloud Haskell and science-focused packages: https://github.com/LaurentRDC

I have experience as a scientific software engineer at NASA's Jet Propulsion Lab, and quantitative research at a systematic proprietary trading firm specialized in North American power markets. I have also tried starting my own startup in the cleantech space (https://powerweave.io/), which ultimately ran out of runway -- still a valuable experience!

I am interested in many things, including reconnecting with my Physics education and research background -- ideally looking for a role tackling open-ended questions which involves high-performance and/or scientific computing, physics, engineering, etc.

Otherwise, climate technologies, national defense, and software correctness are also interesting. But really, I'm interested in being intellectually stimulated, so don't hesitate to reach out!

Personal website and blog: https://laurentrdc.xyz

cosmic_quanta··on Hitting the Jackpot: The Birth of the Monte Carlo Method – LANL (2023)
You seem to know quite a bit about Bayesian statistics; anywhere recommendations of reading material specifically about Bayesian inference applied on time series?
cosmic_quanta··on Hitting the Jackpot: The Birth of the Monte Carlo Method – LANL (2023)
I'm currently going through the Statistical Rethinking [0] class on Bayesian statistics, and it reminded me that Bayesian statistics' renaissance was basically thanks to Monte Carlo methods. Such methods can approximate posterior distributions that are often extremely difficult to calculate analytically.

[0] https://github.com/rmcelreath/stat_rethinking_2023

cosmic_quanta··on Fighting spam with Haskell at Meta (2015)
I recall hearing about this a while back, and how the team at Meta had implemented hotswapping to deploy new rules, without redeploying the entire executable, even though the rules were expressed in a Haskell DSL.

Unfortunately, I have never seen hotswapping of Haskell code anywhere else. All I can find is this library [0] by Simon Marlow.

Together with Cloud Haskell [1], hotwapping would allow to create pretty flexible distributed systems à la Erlang/OTP.

[0]: https://hackage.haskell.org/package/ghc-hotswap

[1]: https://github.com/haskell-distributed/distributed-process

cosmic_quanta··on Optimizing a Rust GPU matmul kernel
I'm not familiar with GPUs specifically, but I have seen this for ORMs that support multiple SQL dialects (e.g. [0]).

A great technique is called 'tagless final encoding' [1]. Using this technique, you can specify capabilities of an embedded domain-specific language (eDSL) such that you can have a shared (but narrow) common set of features, while allowing specializations of this eDSL to support extra features.

[0]: https://github.com/haskell-beam/beam

[1]: https://nrinaudo.github.io/articles/tagless_final.html

cosmic_quanta··on 8 months of OCaml after 8 years of Haskell in production (2023)
Nowadays there are "language editions" (e.g. GHC2024) packing many stable language extensions together. It's definitely safe to turn those on, from a maintenance point of view.

Edit: Link to docs: https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/cont...

cosmic_quanta··on Ask HN: Who wants to be hired? (December 2024)
Location: Montréal, Canada

Remote: I can, but prefer on-site

Willing to relocate: Yes. Easy to get visa for US + Commonwealth countries (NZ, UK, Aus, etc)

Technologies: Haskell, Python, Rust (been a while though), SQL, Git.

Résumé/CV: On request -- all details at https://laurentrdc.xyz/about

Email: laurent `dot` decotret `at` outlook `dot` com

---------

I am a physicist with lots of software experience in many domains, including scientific computing, distributed systems, finance & trading, machine learning, and power grid infrastructure.

I maintain several free and open-source software packages: https://github.com/LaurentRDC

I have experience as a scientific software engineer at NASA's JPL, and quantitative research + software engineer at a proprietary trading firm. I have also tried starting my own startup in the cleantech space (https://powerweave.io/), which ultimately ran out of runway -- still a valuable experience!

I am interested in many things, including reconnecting with my Physics education -- ideally looking for a role which involves high-performance and/or scientific computing, physics, engineering, etc. Otherwise, climate technologies, national defense, and software correctness are also interesting. But really, I'm interested in being intellectually stimulated, so don't hesitate to reach out!

cosmic_quanta··on Ask HN: How can I grow as an engineer without good seniors to learn from?
> "Good judgement comes from experience. Experience comes from bad judgment."

Damn that's good

cosmic_quanta··on Ask HN: How can I grow as an engineer without good seniors to learn from?
I'm in a similar position right now.

I have a few years of experience under my belt, in a small team of ~10 devs. No one is a software engineer, and it's everyone else's first job essentially. There's no one senior from whom to learn, and I feel stagnant.

I improve by interacting with the open-source community. I have been getting more and more involved in several projects over the years, even making it as a maintainer for a few of them.

I recommend you look at smaller communities -- my favourite is Haskell -- as compared to very established ones like Python's. Smaller communities mean that you have more impact as a contributor, which requires you to keep pushing and learning new things. Smaller communities make it also easier to interact with senior people, for example on Reddit or a Discourse instance (e.g. https://discourse.haskell.org)

cosmic_quanta··on Borgo Programming Language
Let's be substantive : What makes Borgo junk? Can you seriously see nothing interesting here compared to Clojure?
cosmic_quanta··on Functional Programming Self-Affirmations
I'm a big fan of Haskell Programming from First Principles. That's where more advanced ideas like Monads started clicking.

https://haskellbook.com/

cosmic_quanta··on Scientific computing with confidence using typed dimensions
That's an excellent point, thanks! I will edit the post
cosmic_quanta··on Scientific computing with confidence using typed dimensions
Interesting, I am intrigued by the support for partial derivatives with typed dimensions. I'll have to check out OpenFOAM
cosmic_quanta··on Scientific computing with confidence using typed dimensions
There are Haskell packages for uncertainty (e.g. [0], based on automatic differentiation [1]). However, these packages don't support typed dimensions, because multiplication/division becomes more complex.

It is my goal to provide quantities with uncertainty AND typed dimensions one day.

[0]: https://hackage.haskell.org/package/uncertain

[1]: https://hackage.haskell.org/package/ad

cosmic_quanta··on Scientific computing with confidence using typed dimensions
> ... not as types, but as special numerical values, more or less (values that you can multiply/divide by any other unit, but can only add/subtract with themselves).

What's so cool about `dimensional` is that the types work the way you describe!

Normally, in Haskell, the addition and multiplication functions are typed like so:

    (+) :: Double -> Double -> Double
    (*) :: Double -> Double -> Double
With `dimensional`, addition looks like:

    (+) :: Quantity d Double -> Quantity d Double -> Quantity d Double
which means you can't add quantities with incompatible dimensions, so far so good. But multiplication looks like:

    (*) :: Quantity d1 Double -> Quantity d2 Double -> Quantity (d1 * d2) Double
That is, the dimensions of the result of multiplication (d1 * d2) follow the physics meaning of multiplication. What can look confusing is that (d1 * d2) is a type-level calculation which is run at compile-time.

This means that `dimensional` isn't only about 'statically checking' dimensions and units, but also inferring them.

You can see this interactively. What is the type of 1 meter divided by 1 second:

    ghci> :t (1 *~ meter) / (1 *~ second)
    Quantity (Dim Pos1 Zero Neg1 Zero Zero Zero Zero) Double
where (Dim Pos1 Zero Neg1 Zero Zero Zero Zero) is a synonym for the dimension of velocity, which is not checked -- it is inferred at compile time.
cosmic_quanta··on Scientific computing with confidence using typed dimensions
The `dimensional` library doesn't provide this, no. However, it's easy to 'tag' data in Haskell using phantom types. For example, for vectors in reference frames:

    newtype Framed f a = MkFramed (Vector a)
    
    add :: Framed f a -> Framed f a -> Framed f a
    add (MkFramed vec1) (MkFramed vec2) = ... add vec1 and vec2
    
    data ReferenceFrame1
    data ReferenceFrame2
    
    v1 :: Framed ReferenceFrame1 Double
    v1 = ...
    
    v2 :: Framed ReferenceFrame2 Double
    v2 = ...
    
    main :: IO ()
    main = print $ v1 `add` v2 -- will not type check
   
There might already be a library to do this
cosmic_quanta··on Scientific computing with confidence using typed dimensions
That's a great question.

Haskell has arrays and matrices of homogeneous types, so it wouldn't work by default.

If you needed this kind of functionality, you would have to create your own Matrix type which would look very similar to a 9-tuple, and then define matrix multiplication. It would then be possible to encode the dimensional constraints in the type signature, but it's already quite involved for 2x2 matrices:

    data Mat2 a b c d 
        = MkMatrix a b c d
    
    matmul :: ???? -- good luck writing this type signature
    matmul (MkMatrix a11 a12 a21 a22) (MkMatrix b11 b12 b21 b22)
        = MkMatrix ((a11 * b11) + (a12 * b21))
                   ((a11 * b12) + (a12 * b22))
                   ((a21 * b11) + (a22 * b21))
                   ((a21 * b12) + (a22 * b22))
I can't imagine for 3x3.
cosmic_quanta··on Scientific computing with confidence using typed dimensions
Something I briefly mention in the post is pint [0] for Python, but unfortunately, I don't think dimensions can be specified via type annotations.

At least you can check the input of functions at runtime [1].

[0]: https://github.com/hgrecco/pint

[1]: https://pint.readthedocs.io/en/stable/advanced/wrapping.html

cosmic_quanta··on Scientific computing with confidence using typed dimensions
Author here, thanks for posting!

On the Haskell Discourse [0], someone posted about another Haskell library, units [1], which allows to define unit systems NOT limited to the 7 physical dimensions. For example, adding a base dimension for currency would be nice to model electricity prices in currency per energy.

[0]: https://discourse.haskell.org/t/blog-post-scientific-computi...

[1]: https://hackage.haskell.org/package/units

← PreviousPage 3 of 9Next →