Skip to content

Instantly share code, notes, and snippets.

# Compilers
- Essentials of compilation book. J. Siek
- [Video] Overview to the "Essentials of compilation" book. 2023. https://www.youtube.com/watch?v=y_6bycM5fV8
- MLIR Tutorial
- [Blog] https://github.com/j2kun/mlir-tutorial
- [Blog] https://jeremykun.com/2023/10/23/mlir-dialect-conversion/
- [Blog] https://jeremykun.com/2023/11/01/mlir-lowering-through-llvm/
https://forms.gle/NqgbySEkzQ9YewJDA
@guillep
guillep / 1 - Load VMMaker
Last active May 22, 2019 09:43
VMMaker scripts
| manifest load |
manifest := #( "('http://source.squeak.org/FFI' 1 ('FFI-Pools' 'FFI-Kernel')) already in Pharo"
('http://source.squeak.org/VMMaker' 6 ('Balloon-Engine-Pools' 'BytecodeSets.spur' 'VMMaker.oscog' 'Cog' 'CogTools' 'ImageFormat'))
('http://source.squeak.org/VMMaker' 0 ('VMMakerCompatibilityForPharo6'))
('http://ss3.gemstone.com/ss/MethodMassage' 3 ('MethodMassage' 'MethodMassageCompatibility'))
('http://www.squeaksource.com/AioPlugin' 7 ('VMConstruction-Plugins-AioPlugin.oscog'))
"('http://www.squeaksource.com/Alien' 0 ('Alien-Core' 'Alien-Tests-Core' 'Alien-Win32')) already in Pharo"
"('http://www.squeaksource.com/FreeTypePlus' 5 ('FreeType')) can't load this. it is toxic to Squeak 4.5"
"('http://www.squeaksource.com/FreetypePlugin' 8 ('Freetype-Plugin')) hence we can do without this"
"('http://www.squeaksource.com/OSProcess' 4 ('OSProcess')) appears to conflict with OSSVMProcess"
styler := SHRBTextStyler new.
text := 'EEEE' asText.
styler classOrMetaClass: Object.
styler styledTextFor: text.
text asOrderedCollection collect: [ :each |
FreeTypeGlyphRenderer current
subGlyphOf: each
colorValue: 0
@guillep
guillep / launch.json
Created January 11, 2019 22:36
VM Scripts
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
@guillep
guillep / gist:f70abb710c523709a67c294b75a8033b
Created May 14, 2018 09:11
How to browse Hermes packages
```
reader := HEBinaryReader new
stream: ('AST-Core.hermes' asFileReference) binaryReadStream;
yourself.
package := HEPackage readFrom: reader.
```
If you inspect the package you will see all the content in the Hermes file (the format allows us to have different root elements in the file, but we are exporting a package per file).
If it is useful we can include it as an inspector.
@guillep
guillep / gist:10acba12517be9ebd43ad53f2160f989
Created May 14, 2018 09:07
How to add item to world menu
This is done via the "worldMenu" pragma.
Browse the senders of #worldMenu and you will see how this is done.
```
menuCommandOn: aBuilder
<worldMenu>
(aBuilder item: #Tools)
order: 1.0;
target: self;
@guillep
guillep / gist:cfdae9dbd69d22e459661d17457a50d0
Created May 14, 2018 08:43
Inverse dependency analysis
report := DADependencyChecker new computeImageDependencies.
report knownDependantsOf: 'Glamour-Examples'
StartupPreferencesLoader default executeAtomicItems: {
StartupAction
name: 'Git Settings'
code: [
FileStream stdout
cr; nextPutAll: 'Setting the ssh credentials'; cr.
Iceberg enableMetacelloIntegration: true.
IceCredentialsProvider useCustomSsh: true.
IceCredentialsProvider sshCredentials
items := OrderedCollection new.
items add: (StartupAction name: 'Setup Pharo Iceberg Repository' code: [ | myRepoLocation |
myRepoLocation := FileLocator home / 'Projects/Pharo/git-repos/pharo'.
IceRepository registry
detect: [ :e | e name = 'pharo' ]
ifFound: [ :pharo |
pharo
location: myRepoLocation;
subdirectory: 'src' ]
]).