Knowledge (XXG)

Parrot intermediate representation

Source 📝

43:
While Parrot is still evolving, it is currently being used in many different capacities, and has undergone several releases.
301: 146:
The calling conventions in Parrot are complex, but all of that complexity can be hidden by using PIR directives:
33: 217:" expands to the required Parrot bytecode, but does not directly represent any fundamental Parrot operation. 51:
PIR provides a set of abstractions that allow the programmer to ignore certain redundancies in the Parrot
29: 281: 266: 55:
and quickly write code that adheres to the complexities of Parrot, such as the calling conventions.
226: 64: 37: 25: 306: 295: 40:, and provides temporary registers and named registers, simplifying code generation. 286: 262: 52: 24:), previously called Intermediate code (IMC), is one of the two 36:
or PASM. Compared to PASM, PIR exists at a slightly higher
8: 213:Each of the directives prefixed with a " 63:PIR provides both type abstraction and 7: 67:to some degree. For example, the " 18:Parrot intermediate representation 14: 1: 71:" operator can be used with 257:If the program is saved as 323: 248:"Hello world!\n" 231: 148: 81: 34:Parrot assembly language 30:Parrot virtual machine 269:with this command: 227:hello world program 142:Calling conventions 302:Assembly languages 26:assembly languages 38:abstraction layer 314: 272: 271:parrot hello.pir 253: 249: 246: 243: 239: 236: 216: 209: 205: 201: 197: 193: 189: 186: 183: 180: 176: 173: 170: 166: 163: 160: 156: 153: 137: 133: 129: 126: 123: 120: 116: 112: 109: 105: 102: 99: 96: 92: 89: 86: 78: 74: 70: 322: 321: 317: 316: 315: 313: 312: 311: 292: 291: 278: 270: 255: 254: 251: 247: 244: 241: 237: 234: 223: 214: 211: 210: 207: 203: 199: 195: 191: 187: 184: 181: 178: 174: 171: 168: 164: 161: 158: 154: 151: 144: 139: 138: 135: 131: 127: 124: 121: 118: 114: 110: 107: 103: 100: 97: 94: 90: 87: 84: 76: 72: 68: 61: 49: 32:. The other is 12: 11: 5: 320: 318: 310: 309: 304: 294: 293: 290: 289: 284: 277: 276:External links 274: 232: 222: 219: 149: 143: 140: 82: 60: 57: 48: 45: 13: 10: 9: 6: 4: 3: 2: 319: 308: 305: 303: 300: 299: 297: 288: 285: 283: 280: 279: 275: 273: 268: 264: 260: 230: 228: 220: 218: 147: 141: 80: 66: 58: 56: 54: 46: 44: 41: 39: 35: 31: 27: 23: 19: 287:PIR examples 261:, it can be 258: 256: 224: 212: 145: 65:polymorphism 62: 59:Abstractions 50: 42: 21: 17: 15: 282:Writing PIR 296:Categories 229:in PIR is 259:hello.pir 79:or both: 267:executed 263:compiled 53:bytecode 47:Overview 28:for the 240: : 221:Example 200:return 245:print 238:hello 179:local 169:param 159:param 119:local 95:local 85:local 307:Perl 265:and 242:main 225:The 206:) . 16:The 252:end 235:sub 208:end 204:tmp 188:tmp 185:tmp 182:int 172:int 162:int 155:foo 152:sub 122:num 115:1.1 98:num 88:int 77:num 73:int 22:PIR 298:: 194:+ 190:= 134:+ 130:= 113:= 106:= 75:, 250:. 233:. 215:. 202:( 198:. 196:b 192:a 177:. 175:b 167:. 165:a 157:. 150:. 136:b 132:a 128:c 125:c 117:. 111:b 108:1 104:a 101:b 93:. 91:a 83:. 69:+ 20:(

Index

assembly languages
Parrot virtual machine
Parrot assembly language
abstraction layer
bytecode
polymorphism
hello world program
compiled
executed
Writing PIR
PIR examples
Categories
Assembly languages
Perl

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.