Skip to content

Instantly share code, notes, and snippets.

View sirinath's full-sized avatar
🎯
Focusing

Suminda Sirinath Salpitikorala Dharmasena sirinath

🎯
Focusing
View GitHub Profile

Foreward

This document was originally written several years ago. At the time I was working as an execution core verification engineer at Arm. The following points are coloured heavily by working in and around the execution cores of various processors. Apply a pinch of salt; points contain varying degrees of opinion.

It is still my opinion that RISC-V could be much better designed; though I will also say that if I was building a 32 or 64-bit CPU today I'd likely implement the architecture to benefit from the existing tooling.

Mostly based upon the RISC-V ISA spec v2.0. Some updates have been made for v2.2

Original Foreword: Some Opinion

The RISC-V ISA has pursued minimalism to a fault. There is a large emphasis on minimizing instruction count, normalizing encoding, etc. This pursuit of minimalism has resulted in false orthogonalities (such as reusing the same instruction for branches, calls and returns) and a requirement for superfluous instructions which impacts code density both in terms of size and

@martinv13
martinv13 / rlm.R
Created December 7, 2018 12:41
Rolling weighted linear model with exponential window computed in linear time.
# This gist demonstrate the use of a linear algorithm to compute exponentially weighted rolling linear regression between two time-series.
# benchmark rolling linear model using R's lm function
# output 2 regression coefficients + R2, ie 3 value per row
# alpha: decay coefficient (last weight = (1 - alpha) * previous weight)
# miny: minimum number of sample required to calculate an output value
rlm <- function(y, x, alpha, miny=10) {
n <- length(y)
@sirinath
sirinath / * Language.md
Last active July 17, 2021 21:22
Language for Data Centric Development and Systems Programming

* Language for Data Centric Development and Systems Programming

[TOC]

Overview

* language is to write correct high-performance code in processing large volumes of static, changing and streaming data. Currently many programming languages are not well geared to manipulate large and changing data required by modern big data tasks. Many languages used to write Big Data and Database systems use language which were not really designed to build such systems.

A modern built language should be usable in:

  • mass manipulation of data which is
@dmnsgn
dmnsgn / WebGL-WebGPU-frameworks-libraries.md
Last active May 8, 2024 18:53
A collection of WebGL and WebGPU frameworks and libraries

A non-exhaustive list of WebGL and WebGPU frameworks and libraries. It is mostly for learning purposes as some of the libraries listed are wip/outdated/not maintained anymore.

Engines and libraries ⚙️

Name Stars Last Commit Description
three.js ![GitHub
@mandubian
mandubian / gist:0fd090c0f75a46346f5e7898eeac9e28
Last active September 15, 2017 15:11
Improving compile-time for structure based on implicits resolutions
@maiermic
maiermic / variance.md
Last active September 26, 2023 16:07
Description of the four kinds of variance: covariance, contravariance, invariance and bivariance.

Variance

The term variance describes how subtyping between higher kinded types is related to subtyping relations of their type arguments.

Higher Kinded Types

A higher kinded type composes type arguments to a new type. I use square bracket notation to define a higher kinded type:

C[T] // The higher kinded type `C` composes type argument `T` to a new type `C[T]`.

The same works with multiple type arguments:

@marketcalls
marketcalls / Camarilla - Pivot Points
Last active October 28, 2022 15:44
Camarilla - Pivot Points
study(title="Camarilla - Marketcalls", shorttitle="Camarilla Pivot Points", overlay=true)
sd = input(true, title="Show Daily Pivots?")
//Camarilla
pivot = (high + low + close ) / 3.0
range = high - low
h5 = (high/low) * close
h4 = close + (high - low) * 1.1 / 2.0
h3 = close + (high - low) * 1.1 / 4.0
scala> def drop[T](xs: List[T], n: Int) = if (xs.isEmpty || n <= 0) xs else drop(xs.tail, n - 1)
drop: [T](xs: List[T], n: Int)List[T]
scala> drop(List(1,2,3,4,5), 3)
res0: List[Int] = List(4, 5)
@daien
daien / simplex_projection.py
Created October 8, 2011 16:56
Compute Euclidean projections on the simplex or L1-ball
""" Module to compute projections on the positive simplex or the L1-ball
A positive simplex is a set X = { \mathbf{x} | \sum_i x_i = s, x_i \geq 0 }
The (unit) L1-ball is the set X = { \mathbf{x} | || x ||_1 \leq 1 }
Adrien Gaidon - INRIA - 2011
"""