HNHacker News
TopNewBestAskShowJobs

victorNicollet

656 karma · joined February 18, 2011

submissionscomments
victorNicollet··on All I want for Christmas is these seven TypeScript improvements
English is not my native language, but looking at the French equivalent, wouldn't the choice of 'X is Y' or 'X are Y' be based on whether X is plural, as opposed to Y ? "Bob is three kids in a trench coat" sounds better than "Bob are three kids in a trench coat"

What's the rule for cases where it is not known whether X is singular or plural ? Phrases like "What we found" or "All I want for Christmas", for example. French grammar has several rules where, if a word must agree with a still unknown number or gender, then singular masculine is used: "J'ai mangé une pomme" vs. "La pomme que j'ai mangée" (the verb agrees with the apple only if the apple appears before it in the sentence).

EDIT: I just realized that "All I want for Christmas" may actually be a plural, but "All I want for Christmas are a cookie" sounds strange...

victorNicollet··on 81% of IT teams directed to reduce or halt cloud spending
Hey, we've had our blob storage costs spike up +70% for two days (Oct 4th and Oct 5th), across almost all of our storage accounts, regions and hot/cold/archive tiers. The spike is a consistent ~70% for each of the affected accounts, and this includes accounts where there have been no writes for months (so why is there an increase), as well as accounts where we never delete (so while an increase would be surprising, the decrease on Oct 6th is impossible). Is this similar to what you're seeing ?

I was considering writing to Azure support about that...

My last billing issue with them took ~120 days to resolve, so I don't have much hope.

victorNicollet··on The Mystery of Numerical Notation on the Dial Plate – 4 Is Expressed as IIII
I remember reading that IIII also made it easier to create the numbers in the first place. A watchmaker would mold VIIIIIX four times, the first would be cut as V, IIII, IX ; the second as VI, III, IX (the latter rotated to become XI) ; the third as VII, II, I, X ; the fourth as VIII, IIX (the latter rotated to become XII).
victorNicollet··on France bans veggie ′steaks,′ ′sausages′ to describe vegetarian products
The vegan community in France already uses names like "Faucisse" and "Fauxmage" based on "Faux + Saucisse" and "Faux + Fromage". I believe there's also "Vromage" (Vegan + Fromage).
victorNicollet··on We will never have enough software developers (2020)
A new feature will take longer to implement on top of a badly designed or misbehaving dependency.
victorNicollet··on Cognition versus Programming: The Big Two – Why TDD?
I share their opinion. I understand "Do the simplest thing" to mean "ignore any additional insights you may have".

If I know that a class will need to be accessed from multiple threads, I am not allowed to use locks, concurrent data structures or lock-free patterns until I add the first test that checks for multiple thread access. When that happens, I need to throw away almost all of the previous implementation. The same happens for any special data structure or algorithm that I know in advance will be necessary to solve the high-level problem, but it takes tens of tests to reach a point where the "simplest solution" no longer works. As an exercise, consider implementing a Union-Find data structure while constraining yourself to never writing a line of code that is not the simplest thing to solve the current test.

My experience has been that it's better in those cases to construct a unit testing roadmap so that:

- you incrementally build the correct solution - you throw away as little code as possible - throughout the process, you minimize the amount of code not covered by a test

victorNicollet··on Monorepos done right
We are using TeamCity for CI, which also supports triggers conditional on paths. It mostly works, as long as your tree is laid out properly.
victorNicollet··on Monorepos done right
Same here. We migrated from 5 repositories down to a single one in 2013, and have been working with a simple PR process (first Phabricator, then Bitbucket) ever since, along with a TeamCity as a CI to run tests and deploy.

We do try to minimize our "technological footprint" by reducing the number of languages, tools, third party packages, etc. But I would say our main strategy is to enforce static analysis everywhere. Global type-checking between C# and F# projects comes out-of-the-box (but you have to design the shared types properly), and we produce TypeScript contracts and signatures out of C# contracts and API endpoints.

victorNicollet··on Monorepos done right
You have found a local optimum that involves multiple repos. Others have found a local optimum that involves a single repo. Arguments for mono-repos are not arguments against multi-repos.

For some background: we migrated from multi-repo to mono-repo to solve several pain points, which are touched on in TFA. It's fair for you to state that you have never had a problem, or that you don't see it, but don't conclude that no one else has ever had that problem, or that they, unlike you, consider that problem to be important enough to need a solution.

> [Single source of truth] has never been a problem for me. You have an app in one repo depending on a version of a package built from another.

But I don't have a package built from another. To support multiple repos, do I need to configure package creation, set up an artifact server, and teach the team how to use a locally-built package for debugging/prototypes ?

> There are lots of changes you can make that the monorepo doesn't detect any more than a multi-repo

There are several techniques for working on a large codebase that involve making easy-to-detect changes, that can then followed to both explore the extent of what the work should cover, and ensure that no piece is forgotten. Having a monorepo makes it easier to put all the code in one place for the static analysis tools to crunch through.

> I don't agree that finding existing functionality to reuse is easier. How so? You search for "Tokenize" and hope to find something relevant?

You can "Find all references" of a specific type to identify functions that can operate on it. The list will usually be short enough to scan in a minute or two. If you're looking for a function to frobnicate that type, it will almost certainly be in the list. I'm not sure how you would this on packages from several repos (especially if that function is non-public).

> "Change the code and get proper reviews", this is nothing to do with monorepos.

My current tooling does not allow me to submit a PR that pushes two different commits to two different repos. If using packages to share code between repos, it also means that the change must deal with package versioning.

There exists a set of tools, techniques and never-been-a-problems that can make mono-repo work and be productive, just like there exists a set of tools, techniques and never-been-a-problems that can do the same for multi-repos.

victorNicollet··on Solid.js feels like what I always wanted React to be
Having recently shopped around, and implemented, this kind of data grid: no JS framework actually handles the hard parts, but (more-or-less complete) libraries exist for nearly all of them.

My specific use case is a React application, and I have found it easier to implement a dedicated listener system, than try to fit things into component states.

victorNicollet··on PRQL – A proposal for a better SQL
There are plenty of good ideas in here, I really like it.

Here's a few things I can say from my experience (I have been working on a "better SQL" for almost 10 years now):

- Your "aggregate by" taking a set of calculations to be performed on the groups is an excellent idea: the fact that "group by X" isn't a separate statement from the "select" that describes the calculations, means you can keep the idea that each line is an operation applied to the result of the previous line.

- Be very careful with auto-generated column names, they will bite you when you implement "Go To Definition" or "Rename Symbol" tools.

- The use of "filter" instead of "where" is a missed opportunity to be easily understood by people who know SQL. I suspect that you wanted to avoid the WHERE/HAVING confusion, but I'm not sure it is worth it. I do appreciate "sort" instead of "order by" (it's good to have only one keyword).

- To support a space-based call convention `f a b` you will pay a very heavy price in the language grammar. Also, allowing optional arguments in this convention will prevent you from implementing first-class, higher-order or partial functions. This may be a price you have decided to pay, if not, look into the OCaml rules for optional arguments, they are very well thought-out (the general idea being, you must have at least one non-optional positional argument _after_ the optional ones).

- Having [X, Y] be your list syntax, and X be a shorthand notation for [X], works out pretty well in practice, so long as you have specific positions in your grammar where lists are expected, so there is no ambiguity between X-as-a-column and X-as-a-shorthand-for-[X]

- General syntax opinions: "from" is fine, your CTE syntax (non-point-free) is fine. Boolean operators should be usable as infix keywords (or prefix if unary), just like arithmetic ones, because that is the first thing users will attempt.

- Raw syntax: for the sake of your syntax highlighter, I recommend having asymmetrical delimiter pairs like [|SQL|] instead of symmetrical pairs like `SQL`.

In addition to the above, one of the issues I have with SQL in an analytics context is that it tends to "lose" the actual tables: since it operates by joining/filtering/aggregating tables into new tables, your "products" table from the database schema is quickly replaced by a CTE named "products5" which (in theory) contains the same lines as the original, plus some additional columns, but (in practice) some lines have been lost or duplicated in the middle. I called this the "vanishing schema" paradox[1]. Your design, with the "let" statements to add columns to a table, solves one portion of the problem, but I wonder if you would consider this worth solving more fully.

[1]: https://nicollet.net/blog/vanishing-schema-paradox.html

victorNicollet··on How to Migrate a Git Repository from GitHub to Bitbucket
For what it's worth, we use the Visual Studio Code extension for reviewing pull requests ; it comes with syntax highlighting and it's more performant than a web-based interface.
victorNicollet··on Ask HN: What does an ML Engineer do?
I'm not sure there is a general introduction, because forecasting in retail sales is extremely dependent on how the forecasts are used, and there are many schools of thought about that.

There's the classic "inspired from manufacturing" approach where you have production targets for your factory, and your planning tool decides how much to purchase from suppliers, and when. Transposed to retail sales, you obviously don't have production targets, so you use forecasting (usually average or median forecasts, daily or weekly), inflate the amounts a bit for "safety stock", and pretend that the forecasts are the targets. You'll usually notice this is the case if the retailer has a Forecasting department that is separate from its Purchasing department, and forecasts are judged on a metric that compares them to actual values (rather than on the outcomes of the decisions made based on them).

Once you allow your forecast method to return something other than time series, you can adapt it to the actual supply chain, and you have a lot more variety depending on how purchasing (and pricing!) decisions are made.

For instance, if you order every week from a given supplier, you instead want to forecast the total sales over the coming week, given as a probability distribution ("there is a P% chance of selling more than Q units). You can then use the actual dollar costs of not having enough units (the margin of a single sale) and of having too many units (storage, carrying and opportunity costs). This lets you optimize dollars instead of how close the forecast was to an actual observation.

There are many levers that can be driven by forecasts, such as raising prices if there isn't enough inventory to serve the demand before the supplier's next delivery, or lowering prices to make room in a warehouse for higher-margin products, or selecting which product appears on the front page of your e-commerce website or in the default position of a configurator drop-down.

There are also limitations, usually around data availability. I would say most companies _that can pay for forecasting development_ have an extensive history of sales data. However, you likely also need information about suppliers (how long do they take to deliver?), about historical stock levels (this product sold zero units over an entire month, was it because it was out-of-stock, or is this a relevant signal for our forecasts?), about price changes and promotional events (usually to explain a sudden jump in sales), and so on. These are not always available. And then, there are entire industries (such as fashion) where individual products never have more than a few months of historical data, because there's a new collection coming out every season.

If you're interested, my employer is producing a "Supply Chain Lectures" series on YouTube which deals with forecasts among other things (but really, the idea is to look at supply chains as a whole, instead of just forecasting): https://www.lokad.com/lectures

victorNicollet··on TDD from the Factorio Team
Let's say we work on the "reverse list" function. A few tests I could write are that the following clauses are true:

    rev([1], [1])
    rev([1, 2, 3], [3, 2, 1])
And maybe also that the following clauses are false:

    rev([1, 2], [1, 2])
    rev([], [1])
    rev([1, 1], [1])
Is Prolog able to infer, from the above, that rev([4, 5], [5, 4]) ? Or to synthesize the general form rev([H|T],R) :- rev(T, RT), concat(RT,[H],R) ?
victorNicollet··on How the World Ran Out of Everything
I'm not sure what you mean. Being exposed to risk is a fact of life in supply chains. Every time you order from a supplier, you have the risk of having ordered too much, and you have the risk of having ordered too little, and the quantity (and timing) of your order is just your way to decide how much you want to be exposed to these two risks. Abandoning JIT does not change that.

Of course, the financial impact of the two risks is not equal. Many supply chains aim at a service level that is higher than 50%: they reduce their exposure to out-of-stock risks by increasing their exposure to overstock risks, because they consider out-of-stock to be much worse than overstock. But where do you draw the line ? What is the correct ratio ? How large should the rainy day fund be ? Is it worth building warehouses and hiring the workforce to run them ?

victorNicollet··on How the World Ran Out of Everything
I wouldn't place the blame on lean/JIT so heavily.

One issue is that many companies still run their inventory management based on static rules like reorder points (if stock is below this quantity, reorder some more), and they have spent the last few years optimizing their static rules by observing out-of-stock and over-stock situations. They ended up with a very brittle system that reacts badly to sudden changes in the environment (such as variations in demand or supplier availability) even if they see these changes coming months in advance, because even if they know that the static rules are wrong, they don't have a process in place to decide what the new rules should be. How do you compute reorder points from scratch ? Do you even have the man-hours available to review all the reorder points in your supply chain, and to update them ?

Companies that use dynamic rules (they optimize their supply chain decisions based on demand and supplier availability forecasts, which are updated as often as possible) already have daily or weekly processes to react to changes in the environment. And while accurate forecasts are hard because of COVID, at least the decisions are consistent with the forecasts.

Another issue is that the crisis hits both suppliers and consumers. If you forecast that your suppliers might become unavailable soon, the right reaction is to front-load large orders (before they are unavailable) and to extract more margin from the inventory you could acquire (by increasing your prices), and I think many supply chains are already fairly good at this. But when the demand might also collapse ? You no longer know if a large order is reasonable (what if you can't sell, because there is no demand?) or if increasing your prices will let you capture more margin (price elasticity changes when buyer budgets change). It really becomes a bet on whether your upstream or downstream will see the largest drop.

victorNicollet··on Don’t use environment variables for configuration
I have only very rarely used environment variables in my own software over the last 20 years. The argument for their use that I have heard the most frequently has been "you would have to be an idiot to not use them" which has thus far failed to convince me. That, and its little brother "you must never have pushed anything to production" seem to find some echo in this thread.

From what I could gather, the actual reasons that Other People use environment variables seem to be:

- Other People use some tool for a reason unrelated to environment variables, and that tool happens to make environment variables extremely easy or convenient. A more pessimistic alternative: that tool makes everything inconvenient except for environment variables. Whatever that tool may be, I suspect that I am not using it.

- Other People write programs that are invoked (I write programs that run continuously), and environment variables improve the ease with which programs can be invoked, which is a concept I never have to deal with.

My programs load their configuration from files at startup ; configuration files are committed to git and included in the build ; secrets live in a remote key vault, with a local cache in case of unavailability. Maybe in the future, I will discover something that environment variables greatly improve about this. I don't know.

victorNicollet··on Shopify says remove Stripe billing or get booted from their app store
The Shopify terms state that if your application accesses the Shopify API and is used by two or more merchants, then you have to give 20% to Shopify.

Do you have any references on there being an exception for apps not installed through the store ? I would be very interested.

victorNicollet··on Shopify says remove Stripe billing or get booted from their app store
On the other hand, if you pay $2000/month for some other service, you may be unhappy with having to pay an additional $500 just to have it connect to Shopify to expose some data.
victorNicollet··on Shopify says remove Stripe billing or get booted from their app store
This is absolutely not the wording of the Shopify terms.

If your application 1. uses the Shopify API and 2. is sold to more than one Shopify customer, then Shopify takes 20% of your revenue. Presence on the optional distribution platform is not necessary.

victorNicollet··on Ask HN: What projects are you working on now?
I started working on a C# library that provides LINQ features for Span<T> : https://github.com/VictorNicollet/NoAlloq

I suppose it's a bit like adding a copy-paste app to iOS, only for iOS to finally introduce that feature the next year.

victorNicollet··on Why Germans won’t heat their homes even with free electricity?
A better example would be plastic production. In an emergency stop, factories need to change several pipes because the plastic solidified inside. Stopping production properly takes days, and even then, resuming it also takes days.
victorNicollet··on Why are we so bad at software engineering?
It still adds up slower than many other engineering areas. A recent technical problem on my subway line (Paris Métro 6) delayed everyone by 30 minutes for about an hour. Based on average ridership figures from Wikipedia, this adds up to ~250 days lost. An article from 2016 [1] places the downtime at ~2h16 per month for that line. That's ~1000 days lost per month, for only one subway line.

[1]: http://www.leparisien.fr/info-paris-ile-de-france-oise/metro...

I'm certain that even the current Windows 10 search bug doesn't come close to that kind of impact.

victorNicollet··on Stage is a minimalistic 2D, cross-platform HTML5 game engine
There used to be a time when the game would render to a buffer slightly larger than the screen, then blit the right portion of that buffer to the screen. This meant that scrolling just consisted in blitting from a different offset. Composing the background image, then, would only require changing the bits behind animated sprites (so you would usually intersect the old and new position of each sprite with the background tile grid to find which tiles to draw again).

All of this changed with the advent of 3d hardware acceleration, but I remember doing it up until 2005 to get significant performance gains (on bad hardware).

victorNicollet··on Not everyone has an internal monologue
I can imagine a complete monologue in my head, but it's always intentional, and I only speak to myself when trying to coach or motivate myself into doing something (it does not always work).

Most of the things I think, especially at work... I have no idea how to express them in words. A recursive algorithm to traverse a graph, a strategy in a video game, a scene in a book I'm writing, insight about something I'm feeling...

victorNicollet··on Not everyone has an internal monologue
I do exactly the same. Started when I was 6, walking around in circles, just imagining things. Music makes it even easier. It also helps deal with frustrations and anxiety by imagining catarthic scenes.

I still spend an hour each day doing that during my commute.

I've found that improv theatre and writing books really helps with the "getting it out of my head" part.

victorNicollet··on Ask HN: I just wrote an O(N) diffing algorithm – what am I missing?
Question: why do you ensure that you are only moving forward? Does it matter, for line highlighting, that a line has moved up, or now appears twice?
victorNicollet··on Ask HN: I just wrote an O(N) diffing algorithm – what am I missing?
React also doesn't need a diff to be of the "longest common subsequence" kind. For instance, the diff between "AB" and "BA" involves no insertion or deletion, just transposition, which React supports but traditional diffs don't.
victorNicollet··on .NET Core 3.0 Concludes the .NET Framework API Porting Project
Using cookies in HttpClient strikes me as a rare situation.
victorNicollet··on MathSharp, a vector and matrix library written in C# using hardware intrinsics
This is exactly what is happening here. The JIT generates code at runtime based on the target machine's capability.
← PreviousPage 3 of 9Next →