Recent submissions

Comment · 6 years ago
Comment · 6 years ago
No benchmarks or any other numbers. I wonder how much faster some typical Go code (some CLIs, Hugo or webservices) will run? Around 1%, 5% or 10%?

The Go compiler doesn't need to be smarter for Go's usecase. If it can be made smarter, fine. For best possible performance look at C/C++ or Rust.

Comment · 6 years ago
What issues are there with the privacy policies? Did I miss something?
Comment · 6 years ago
Comment · 6 years ago
Comment · 7 years ago
Comment · 7 years ago
Rust needs to settle down to reach broader adaption, because the ecosystem must stabelize. No business oriented project manager would choose Rust as an alterative to Go or Java while Rust has "only" a community http lib on version 0.12.

Sure, async needs to be shipped and polished, but then Rust needs to tell the world: "We have all you need and as stable as you need."

Comment · 7 years ago
> Google's impact on the world is strongly positive.

I couldn't disagree more. Google doesn't make bazillions of dollars because they provide us with live traffic on maps. Google has significantly enabled and actively driven the mindless consume-everything-all-the-time culture with all the horrible consequences for our mental-health and the environment.

The world would be a much better place without the ones like Google, Facebook and Amazon.

Comment · 7 years ago
Comment · 7 years ago
Agreed that this is trivial model.

Regarding React: In many webgl use-cases UI-framework overhead can be neglected as the user interacts either with the scene or the UI rendered by the framework. The browser doesn't usually need to update the DOM and the scene in one frame.

Comment · 7 years ago
I've used PyQt some years ago and loved it. I can't remember any bigger issues at all. Super productive and fun.
Comment · 7 years ago
This does a good job: https://gist.github.com/staltz/868e7e9bc2a7b8c1f754

We are using reactive programming basically everywhere. Example (Angular):

The Angular Router has an Observable "paramMap". We don't subscribe to it but are creating another Observable for the data that should be loaded.

  getData$ = (
    paramMap$: Observable<ParamMap>
  ): Observable<MyData> => {
    return paramMap$.pipe(
      // Create a query string
      map(paramMap => {
        // some pure function - business logic
        return getSomeQueryBasedOnTheRouteParams(
          paramMap 
        );
      }),
      // get the data
      // select$ is a method on the customStore that wraps the http client and does some more stuff
      // The switchMap is actually one of the concepts that I found initially not the easiest to understand 
      switchMap(someQuery=> {
        return this.customStore.select$({
          query: someQuery
        });
      }),
      map(rawData => {
        // pure function with business logic
        return modifyData(rawData);
      }),
      shareReplay()
    );
  };
Then it goes on with filtering, etc.

   getFilteredData$ = (
     // filter:$ is in our case a simple Subject we're calling next(newFilterValue)
     // NGRX, NGXS or Akita are popular state management libraries to manage this kind of state
     filter$: BehaviourSubject<string>,
     data$: Observable<MyData>): Observable<MyData> => {
        combineLatest(filter$, data$).pipe(
          // Do the filtering using pure functions
          map( ...
            return myFilterFuntion(filter, data);
          )
        )
   };
The filteredData$ Observable can be consumed via async pipe in a component.

The business logic is the same as in imperative-pull code. But using the abstraction of RxJS a lot of boilerplate and indirection vanishes. RxJS is not the easiest abstraction to learn (for me), but as with all, once you're comfortable a lot of the likely intimidating code above will become familiar. You just focus on writing business-logic in pure functions and combine it with RxJS.

Comment · 7 years ago
>> because of the side effects that get caused from subscriptions.

Hmmmm, I wonder how a subscription can cause side effects? I can only think of mutating the data in the subscription. But that should not be done.

We are using RxJS with great success but you should go all the way with Observables: All computations/combination/etc. should be done in pipe()s. If you need to combine some plain data with Observables create a subject for the plain data and pipe(combineLatest(),map(), ...). Don't mix it into subscriptions. Subscribe at the very end of the chain. No modification in subscribtions.

Comment · 8 years ago
Very efficient usage of CPU and RAM. Regarding cloud functions like AWS lambda: Fast startup.
Comment · 8 years ago
How are you wrapping your Rust code? Lambda doesn't support it yet, does it?

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton