To install click the Add extension button. That's it.

The source code for the WIKI 2 extension is being checked by specialists of the Mozilla Foundation, Google, and Apple. You could also do it yourself at any point in time.

4,5
Kelly Slayton
Congratulations on this excellent venture… what a great idea!
Alexander Grigorievskiy
I use WIKI 2 every day and almost forgot how the original Wikipedia looks like.
Live Statistics
English Articles
Improved in 24 Hours
Added in 24 Hours
What we do. Every page goes through several hundred of perfecting techniques; in live mode. Quite the same Wikipedia. Just better.
.
Leo
Newton
Brights
Milds

Parrot intermediate representation

From Wikipedia, the free encyclopedia

The Parrot intermediate representation (PIR), previously called Intermediate code (IMC), is one of the two assembly languages for the Parrot virtual machine. The other is Parrot assembly language or PASM. Compared to PASM, PIR exists at a slightly higher abstraction layer, and provides temporary registers and named registers, simplifying code generation.

While Parrot is still evolving, it is currently being used in many different capacities, and has undergone several releases.

YouTube Encyclopedic

  • 1/3
    Views:
    12 053
    3 501
    358
  • Fine art show with Rob McGregor on Colour In Your Life featuring spectacular & colourful landscapes
  • racket definitions video 3/4 --- define functions without design
  • The River War, An Account of the Reconquest of the Sudan by Winston S. Churchill

Transcription

Overview

PIR provides a set of abstractions that allow the programmer to ignore certain redundancies in the Parrot bytecode and quickly write code that adheres to the complexities of Parrot, such as the calling conventions.

Abstractions

PIR provides both type abstraction and polymorphism to some degree. For example, the "+" operator can be used with int, num or both:

 .local int a
 .local num b
 a = 1
 b = 1.1
 .local num c
 c = a + b

Calling conventions

The calling conventions in Parrot are complex, but all of that complexity can be hidden by using PIR directives:

 .sub foo
  .param int a
  .param int b
  .local int tmp
  tmp = a + b
  .return (tmp)
 .end

Each of the directives prefixed with a "." expands to the required Parrot bytecode, but does not directly represent any fundamental Parrot operation.

Example

The hello world program in PIR is

 .sub hello :main
  print "Hello world!\n"
 .end

If the program is saved as hello.pir, it can be compiled and executed with this command: parrot hello.pir

External links

This page was last edited on 28 February 2024, at 19:23
Basis of this page is in Wikipedia. Text is available under the CC BY-SA 3.0 Unported License. Non-text media are available under their specified licenses. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. WIKI 2 is an independent company and has no affiliation with Wikimedia Foundation.