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 =
➜ 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 / 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 / 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
@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 / Log.txt
Created October 4, 2021 14:59
Dune fails to be compiled after pinngs. Env variable works around bad version of stdune-unstable
➜ ~ OPAMIGNORECONSTRAINTS=stdune-unstable opam pin add git@github.com:Kakadu/dune.git\#dune-sites-test --yes 4.12.0+options
This will pin the following packages: dune-action-plugin, dune-bench, dune-build-info, dune-configurator, dune-glob, dune-private-libs, dune-rpc-lwt,
dune-rpc, dune-site, dune, dyn, stdune-unstable, xdg. Continue? [Y/n] y
[NOTE] Package dune-action-plugin is already pinned to git+ssh://git@github.com/Kakadu/dune.git#dune-sites-test (version 2.9.1).
dune-action-plugin is now pinned to git+ssh://git@github.com/Kakadu/dune.git#dune-sites-test (version 2.9.1)
[NOTE] Package dune-bench is already pinned to git+ssh://git@github.com/Kakadu/dune.git#dune-sites-test (version ~dev).
dune-bench is now pinned to git+ssh://git@github.com/Kakadu/dune.git#dune-sites-test (version ~dev)
[NOTE] Package dune-build-info is already pinned to git+ssh://git@github.com/Kakadu/dune.git#dune-sites-test (version 2.9.0).
dune-build-info is now pinned to git+ssh://git@github.com/Ka
@Kakadu
Kakadu / darktable-cltest.txt
Created September 14, 2021 07:59
darktable-cltest
➜ amdgpu-pro darktable-cltest
0.020131 [opencl_init] opencl related configuration options:
0.020144 [opencl_init]
0.020146 [opencl_init] opencl: 1
0.020147 [opencl_init] opencl_scheduling_profile: 'default'
0.020149 [opencl_init] opencl_library: ''
0.020151 [opencl_init] opencl_memory_requirement: 768
0.020153 [opencl_init] opencl_memory_headroom: 400
0.020154 [opencl_init] opencl_device_priority: '*/!0,*/*/*/!0,*'
0.020157 [opencl_init] opencl_mandatory_timeout: 200