Skip to content

Instantly share code, notes, and snippets.

View Kakadu's full-sized avatar

Dmitrii Kosarev Kakadu

  • (ex-)JetBrains Research
  • Saint-Petersburg, Russia
View GitHub Profile
$ cat print.ml | ../../back_amd64/amd64_compiler.exe -o program.asm -vamd64 --no-start -
After ANF transformation.
let prod a b =
(2 * b)
let main =
let temp2 = prod 1 in
let w = temp2 8 in
let u = print w in
0
ANF: let prod a b =
@Kakadu
Kakadu / sorto.rkt
Created February 24, 2017 14:43
Realtional sorting in MiniKanren
#lang racket
(require racket/include)
(require "../faster-miniKanren/mk.rkt")
(include "../faster-miniKanren/test-check.scm")
(define peano
(lambda (n)
(conde
((== 'z n))
➜ 3fortran cat a.f90
program Test2
integer :: i
i=2147483647 ! max
print *,"i=",i
print *,"1+i=",(1+i)
end program Test2
➜ 3fortran gfortran a.f90 && ./a.out
i= 2147483647
@Kakadu
Kakadu / build.txt
Last active April 17, 2022 12:48
Qt 6.4~ android compilation error
➜ build-qt6 ninja
[257/4030] Building Java objects for Qt6Android.jar
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
[518/4030] Automatic MOC for target Network
AutoMoc: /media/work/qt-android/qt6/qtbase/src/network/access/qnetworkaccessdebugpipebackend_p.h:0:1: note: No relevant classes found. No output generated.
[935/4030] Automatic MOC and UIC for target Widgets
AutoMoc: /media/work/qt-android/qt6/qtbase/src/widgets/styles/qstylesheetstyle_p.h:0:1: note: No relevant classes found. No output generated.
[1194/4030] Building CXX object qtbase/src/plugins/platforms/android/CMakeFiles/QAndroidIntegrationPlugin.dir/qandroidinputcontext.cpp.o
/media/work/qt-android/qt6/qtbase/src/plugins/platforms/android/qandroidinputcontext.cpp:890:2: warning: TODO extract the needed data from query [-W#warnings]
@Kakadu
Kakadu / main.cpp
Created October 28, 2013 09:11
QtQuick demo about signal in QML and slot in C++
#include <QtGui/QGuiApplication>
#include "signalslotlistview.h"
#include <QtQuick/QQuickItem>
#include <QtQuick/QQuickView>
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQuickView *view = new QQuickView();
@Kakadu
Kakadu / log.txt
Created February 10, 2022 14:03
dune test formatting of dune files
➜ 1 cat dune-project 4.13.1+flambda
(lang dune 2.9)
(name A)
(package
(name A)
(description
"\| this is a block
"\| of text"
@Kakadu
Kakadu / a.ml
Created January 18, 2022 19:28
Typedtree and GADT
module _ = struct
(* OCaml 3.12.1 *)
open Typedtree
type ttt = { self : 'a . 'a pattern_desc pattern_data -> bool}
let _hack =
let helper (type a)
(self : ttt)
(p1: a Typedtree.pattern_desc pattern_data) =
match p1.pat_desc with
@Kakadu
Kakadu / .ocamlformat
Last active January 16, 2022 22:19 — forked from eupp/dune
Demo of OCanren's reifiers without modules
We couldn’t find that file to show.
@Kakadu
Kakadu / a.ml
Created November 14, 2021 09:22
Stack overflow
➜ cps git:(master) ✗ dune exec ./cps_main.exe
Entering directory '/media/work/asp/fp2020/materials/code'
Entering directory '/media/work/asp/fp2020/materials/code'
[1] 10116 segmentation fault dune exec ./cps_main.exe
➜ cps git:(master) ✗ dune exec ./cps_main.exe
Entering directory '/media/work/asp/fp2020/materials/code'
Entering directory '/media/work/asp/fp2020/materials/code'
depth = 523664, size_tail = 523664
depth = 523665, size_tail = 523665
➜ cps git:(master) ✗ dune exec ./cps_main.exe
@Kakadu
Kakadu / gist:de73d0993699263cb48c9b45a225774e
Last active November 12, 2021 13:56
alerts demo not working properly
➜ /tmp cat a.ml 4.12.1+flambda
[@@@alert unsafe "This module is unsafe!"]
let is_interesting_var _ _ =
(assert false [@alert not_implemented "1asdf"])
[@@deprecated "Please do something else"]
[@@@ocaml.alert deprecated "Please do something else"]
➜ /tmp ocamlc -c a.ml -alert +not_implemented -alert +deprecated -w +3 4.12.1+flambda