Original articles by Mark Leair, PGI Compiler Engineer
This is Part 1 of a series of articles:
Original articles by Mark Leair, PGI Compiler Engineer
This is Part 1 of a series of articles:
I have a pet project I work on, every now and then. CNoEvil.
The concept is simple enough.
What if, for a moment, we forgot all the rules we know. That we ignore every good idea, and accept all the terrible ones. That nothing is off limits. Can we turn C into a new language? Can we do what Lisp and Forth let the over-eager programmer do, but in C?
I’m working on a new language (Fjord) for a shell (fj). Although I have some ideas of my own for syntax, I’m not sure if they’re a really bad idea or if they’re fine, so I’ve decided to conduct a ‘sanity check’ of sorts by writing some preliminary ideas down here. Please respond down in the comments with any thoughts you have!
Note: throughout this document I’ll refer to functions, which are what I’m calling commands.
As this is a language for a shell,
import requests | |
from bs4 import BeautifulSoup | |
import re | |
import graph_tool.all as gt | |
def get_html_content(url): | |
r = requests.get(url) | |
return r.text | |
inf_by_regex = re.compile('Influenced by') |
import cv2 | |
import numpy as np | |
#from skimage.measure import compare_ssim | |
from skimage.metrics import structural_similarity | |
import click | |
@click.command() | |
@click.option("-o" , "--output" , default = None , type=str , help = "Output File") | |
@click.argument("image1" , type = str) |
// g++ *.cpp -o vulkan -lSDL2main -lSDL2 -lvulkan-1 | |
// https://vulkan-tutorial.com/ | |
#include <iostream> | |
using namespace std; | |
#include <SDL2/SDL.h> | |
SDL_Window *window; | |
char* window_name = "example SDL2 Vulkan application"; |
" Vim syntax file | |
" Language: Todo | |
" Maintainer: Huy Tran | |
" Latest Revision: 14 June 2020 | |
if exists("b:current_syntax") | |
finish | |
endif | |
" Custom conceal |
tweets.csv comes from `twint -u dam_io --csv -o tweets.csv` |
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#define SECONDS 6 /* you can change this to suit for your preferences */ | |
#define LENGTH 300 /* you can experiment with different string length */ | |
char wav_struct[] = { | |
'R', 'I', 'F', 'F', |
This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.
Description | Syntax |
---|---|
Get the length of a string | ${#VARNAME} |
Get a single character | ${VARNAME[index]} |