The Black Hole:
Study and not in version, is simplicity. The base understanding replies without demise as the comprehension is again simplicity. To understand and study the "Black Hole" requires no fancy math eval. (In some programming languages, eval is a function which evaluates a string as though it were an expression and returns a result; in others, it executes multiple lines of code as though they had been included instead of the line including the eval.(-https://en.wikipedia.org/wiki/Eval )).
Imagine drill bits;
Rotation
The Sun rotates too: "Solar rotation varies with latitude. The Sun is not a solid body, but is composed of a gaseous plasma. Different latitudes rotate at different periods (differential rotation). The source of this differential rotation is an area of current research in solar astronomy[1]. The rate of surface rotation is observed to be the fastest at the equator (latitude φ = 0°) and to decrease as latitude increases. The solar rotation period is 24.47 days at the equator and almost 38 days at the poles."-https://en.wikipedia.org/wiki/Solar_rotation
I see Space as solid that must be drilled through to achieve air, it is the volume that makes the air convert to the adjustment of Space again. The Ozark Miners are a love of mine in heart and mind as their prowess of work is the encyclopedia should this be their teaching and not just my said to write.
This is just a brief explanation as the most recent weirdness of the photograph and news articles (see previous post) made such a direct hit on my conscious as it was said on the local news that it took the entire World to photograph that and I know that that amount of money would be not of interest to any study as by said in article the 'light-years' would stop all research and reply only a stop by halted in any research. This brief is to engage the average interested to employ not light-years away as the only common course of such dynamics, rather look to NASA and the study of our very own universe!!
These studies have turned our attention to ourselves and since NASA has produced a magnitude of photographs of our universe the study thereof is not only obtainable it will open the conscious mind to invite further thought and not distant thunk. As this is different to gear of said it is important that we as a Country pride ourselves on our very own accomplishments, not first, not last but always.
I also know that we should stay together at all times and to engage thought to think achieving thunk for a far away plan of that article written (see previous post) separates our bearing.
Neil Armstrong
Apollo 11 was the spaceflight that landed the first two people on the Moon. Commander Neil Armstrong and lunar module pilot Buzz Aldrin, both American, landed the Apollo Lunar Module Eagle on July 20, 1969, at 20:17 UTC.
Black hole
Part of a series of articles about |
General relativity |
---|
Objects whose gravitational fields are too strong for light to escape were first considered in the 18th century by John Michell and Pierre-Simon Laplace.[12] The first modern solution of general relativity that would characterize a black hole was found by Karl Schwarzschild in 1916, although its interpretation as a region of space from which nothing can escape was first published by David Finkelstein in 1958. Black holes were long considered a mathematical curiosity; it was during the 1960s that theoretical work showed they were a generic prediction of general relativity. The discovery of neutron stars by Jocelyn Bell Burnell in 1967 sparked interest in gravitationally collapsed compact objects as a possible astrophysical reality.
Black holes of stellar mass are expected to form when very massive stars collapse at the end of their life cycle. After a black hole has formed, it can continue to grow by absorbing mass from its surroundings. By absorbing other stars and merging with other black holes, supermassive black holes of millions of solar masses (M☉) may form. There is general consensus that supermassive black holes exist in the centers of most galaxies.
Despite its invisible interior, the presence of a black hole can be inferred through its interaction with other matter and with electromagnetic radiation such as visible light. Matter that falls onto a black hole can form an external accretion disk heated by friction, forming some of the brightest objects in the universe. If there are other stars orbiting a black hole, their orbits can be used to determine the black hole's mass and location. Such observations can be used to exclude possible alternatives such as neutron stars. In this way, astronomers have identified numerous stellar black hole candidates in binary systems, and established that the radio source known as Sagittarius A*, at the core of the Milky Way galaxy, contains a supermassive black hole of about 4.3 million solar masses.
On 11 February 2016, the LIGO collaboration announced the first direct detection of gravitational waves, which also represented the first observation of a black hole merger.[13] As of December 2018, eleven gravitational wave events have been observed that originated from ten merging black holes (along with one binary neutron star merger).[14][15] On 10 April 2019, the first ever direct image of a black hole and its vicinity was published, following observations made by the Event Horizon Telescope in 2017 of the supermassive black hole in Messier 87's galactic centre.[3][16]
History
General relativity
In 1915, Albert Einstein developed his theory of general relativity, having earlier shown that gravity does influence light's motion. Only a few months later, Karl Schwarzschild found a solution to the Einstein field equations, which describes the gravitational field of a point mass and a spherical mass.[22] A few months after Schwarzschild, Johannes Droste, a student of Hendrik Lorentz, independently gave the same solution for the point mass and wrote more extensively about its properties.[23][24] This solution had a peculiar behaviour at what is now called the Schwarzschild radius, where it became singular, meaning that some of the terms in the Einstein equations became infinite. The nature of this surface was not quite understood at the time. In 1924, Arthur Eddington showed that the singularity disappeared after a change of coordinates (see Eddington–Finkelstein coordinates), although it took until 1933 for Georges Lemaître to realize that this meant the singularity at the Schwarzschild radius was a non-physical coordinate singularity.[25] Arthur Eddington did however comment on the possibility of a star with mass compressed to the Schwarzschild radius in a 1926 book, noting that Einstein's theory allows us to rule out overly large densities for visible stars like Betelgeuse because "a star of 250 million km radius could not possibly have so high a density as the sun. Firstly, the force of gravitation would be so great that light would be unable to escape from it, the rays falling back to the star like a stone to the earth. Secondly, the red shift of the spectral lines would be so great that the spectrum would be shifted out of existence. Thirdly, the mass would produce so much curvature of the space-time metric that space would close up around the star, leaving us outside (i.e., nowhere)."[26][27]In 1931, Subrahmanyan Chandrasekhar calculated, using special relativity, that a non-rotating body of electron-degenerate matter above a certain limiting mass (now called the Chandrasekhar limit at 1.4 M☉) has no stable solutions.[28] His arguments were opposed by many of his contemporaries like Eddington and Lev Landau, who argued that some yet unknown mechanism would stop the collapse.[29] They were partly correct: a white dwarf slightly more massive than the Chandrasekhar limit will collapse into a neutron star,[30] which is itself stable. But in 1939, Robert Oppenheimer and others predicted that neutron stars above another limit (the Tolman–Oppenheimer–Volkoff limit) would collapse further for the reasons presented by Chandrasekhar, and concluded that no law of physics was likely to intervene and stop at least some stars from collapsing to black holes.[31] Their original calculations, based on the Pauli exclusion principle, gave it as 0.7 M☉; subsequent consideration of strong force-mediated neutron-neutron repulsion raised the estimate to approximately 1.5 M☉ to 3.0 M☉.[32] Observations of the neutron star merger GW170817, which is thought to have generated a black hole shortly afterward, have refined the TOV limit estimate to ~2.17 M☉.[33][34][35][36][37]
Oppenheimer and his co-authors interpreted the singularity at the boundary of the Schwarzschild radius as indicating that this was the boundary of a bubble in which time stopped. This is a valid point of view for external observers, but not for infalling observers. Because of this property, the collapsed stars were called "frozen stars", because an outside observer would see the surface of the star frozen in time at the instant where its collapse takes it to the Schwarzschild radius.[38]
Golden age
In 1958, David Finkelstein identified the Schwarzschild surface as an event horizon, "a perfect unidirectional membrane: causal influences can cross it in only one direction".[39] This did not strictly contradict Oppenheimer's results, but extended them to include the point of view of infalling observers. Finkelstein's solution extended the Schwarzschild solution for the future of observers falling into a black hole. A complete extension had already been found by Martin Kruskal, who was urged to publish it.[40]These results came at the beginning of the golden age of general relativity, which was marked by general relativity and black holes becoming mainstream subjects of research. This process was helped by the discovery of pulsars by Jocelyn Bell Burnell in 1967,[41][42] which, by 1969, were shown to be rapidly rotating neutron stars.[43] Until that time, neutron stars, like black holes, were regarded as just theoretical curiosities; but the discovery of pulsars showed their physical relevance and spurred a further interest in all types of compact objects that might be formed by gravitational collapse.[citation needed]
In this period more general black hole solutions were found. In 1963, Roy Kerr found the exact solution for a rotating black hole. Two years later, Ezra Newman found the axisymmetric solution for a black hole that is both rotating and electrically charged.[44] Through the work of Werner Israel,[45] Brandon Carter,[46][47] and David Robinson[48] the no-hair theorem emerged, stating that a stationary black hole solution is completely described by the three parameters of the Kerr–Newman metric: mass, angular momentum, and electric charge.[49]
At first, it was suspected that the strange features of the black hole solutions were pathological artifacts from the symmetry conditions imposed, and that the singularities would not appear in generic situations. This view was held in particular by Vladimir Belinsky, Isaak Khalatnikov, and Evgeny Lifshitz, who tried to prove that no singularities appear in generic solutions. However, in the late 1960s Roger Penrose[50] and Stephen Hawking used global techniques to prove that singularities appear generically.[51]
Work by James Bardeen, Jacob Bekenstein, Carter, and Hawking in the early 1970s led to the formulation of black hole thermodynamics.[52] These laws describe the behaviour of a black hole in close analogy to the laws of thermodynamics by relating mass to energy, area to entropy, and surface gravity to temperature. The analogy was completed when Hawking, in 1974, showed that quantum field theory predicts that black holes should radiate like a black body with a temperature proportional to the surface gravity of the black hole.[53]
Etymology
John Michell used the term "dark star",[54] and in the early 20th century, physicists used the term "gravitationally collapsed object". Science writer Marcia Bartusiak traces the term "black hole" to physicist Robert H. Dicke, who in the early 1960s reportedly compared the phenomenon to the Black Hole of Calcutta, notorious as a prison where people entered but never left alive.[55]The term "black hole" was used in print by Life and Science News magazines in 1963,[55] and by science journalist Ann Ewing in her article "'Black Holes' in Space", dated 18 January 1964, which was a report on a meeting of the American Association for the Advancement of Science held in Cleveland, Ohio.[56][57]
In December 1967, a student reportedly suggested the phrase "black hole" at a lecture by John Wheeler;[56] Wheeler adopted the term for its brevity and "advertising value", and it quickly caught on,[58] leading some to credit Wheeler with coining the phrase.[59]
Properties and structure
These properties are special because they are visible from outside a black hole. For example, a charged black hole repels other like charges just like any other charged object. Similarly, the total mass inside a sphere containing a black hole can be found by using the gravitational analog of Gauss's law, the ADM mass, far away from the black hole.[60][clarification needed] Likewise, the angular momentum can be measured from far away using frame dragging by the gravitomagnetic field.[clarification needed]
When an object falls into a black hole, any information about the shape of the object or distribution of charge on it is evenly distributed along the horizon of the black hole, and is lost to outside observers. The behavior of the horizon in this situation is a dissipative system that is closely analogous to that of a conductive stretchy membrane with friction and electrical resistance—the membrane paradigm.[61] This is different from other field theories such as electromagnetism, which do not have any friction or resistivity at the microscopic level, because they are time-reversible. Because a black hole eventually achieves a stable state with only three parameters, there is no way to avoid losing information about the initial conditions: the gravitational and electric fields of a black hole give very little information about what went in. The information that is lost includes every quantity that cannot be measured far away from the black hole horizon, including approximately conserved quantum numbers such as the total baryon number and lepton number. This behavior is so puzzling that it has been called the black hole information loss paradox.[62][63]
Physical properties
The simplest static black holes have mass but neither electric charge nor angular momentum. These black holes are often referred to as Schwarzschild black holes after Karl Schwarzschild who discovered this solution in 1916.[22] According to Birkhoff's theorem, it is the only vacuum solution that is spherically symmetric.[64] This means that there is no observable difference between the gravitational field of such a black hole and that of any other spherical object of the same mass. The popular notion of a black hole "sucking in everything" in its surroundings is therefore only correct near a black hole's horizon; far away, the external gravitational field is identical to that of any other body of the same mass.[65]Solutions describing more general black holes also exist. Non-rotating charged black holes are described by the Reissner–Nordström metric, while the Kerr metric describes a non-charged rotating black hole. The most general stationary black hole solution known is the Kerr–Newman metric, which describes a black hole with both charge and angular momentum.[66]
While the mass of a black hole can take any positive value, the charge and angular momentum are constrained by the mass. In Planck units, the total electric charge Q and the total angular momentum J are expected to satisfy
Due to the relatively large strength of the electromagnetic force, black holes forming from the collapse of stars are expected to retain the nearly neutral charge of the star. Rotation, however, is expected to be a universal feature of compact astrophysical objects. The black-hole candidate binary X-ray source GRS 1915+105[68] appears to have an angular momentum near the maximum allowed value. That uncharged limit is[69]
Class | Approx. mass |
Approx. size |
---|---|---|
Supermassive black hole | 105–1010 MSun | 0.001–400 AU |
Intermediate-mass black hole | 103 MSun | 103 km ≈ REarth |
Stellar black hole | 10 MSun | 30 km |
Micro black hole | up to MMoon | up to 0.1 mm |
Event horizon
The defining feature of a black hole is the appearance of an event horizon—a boundary in spacetime through which matter and light can only pass inward towards the mass of the black hole. Nothing, not even light, can escape from inside the event horizon. The event horizon is referred to as such because if an event occurs within the boundary, information from that event cannot reach an outside observer, making it impossible to determine if such an event occurred.[74]As predicted by general relativity, the presence of a mass deforms spacetime in such a way that the paths taken by particles bend towards the mass.[75] At the event horizon of a black hole, this deformation becomes so strong that there are no paths that lead away from the black hole.[76]
To a distant observer, clocks near a black hole would appear to tick more slowly than those further away from the black hole.[77] Due to this effect, known as gravitational time dilation, an object falling into a black hole appears to slow as it approaches the event horizon, taking an infinite time to reach it.[78] At the same time, all processes on this object slow down, from the view point of a fixed outside observer, causing any light emitted by the object to appear redder and dimmer, an effect known as gravitational redshift.[79] Eventually, the falling object fades away until it can no longer be seen. Typically this process happens very rapidly with an object disappearing from view within less than a second.[80]
On the other hand, indestructible observers falling into a black hole do not notice any of these effects as they cross the event horizon. According to their own clocks, which appear to them to tick normally, they cross the event horizon after a finite time without noting any singular behaviour; in classical general relativity, it is impossible to determine the location of the event horizon from local observations, due to Einstein's equivalence principle.[81][82]
The shape of the event horizon of a black hole is always approximately spherical.[Note 4][85] For non-rotating (static) black holes the geometry of the event horizon is precisely spherical, while for rotating black holes the event horizon is oblate.[86]
Singularity
At the center of a black hole, as described by general relativity, lies a gravitational singularity, a region where the spacetime curvature becomes infinite.[87] For a non-rotating black hole, this region takes the shape of a single point and for a rotating black hole, it is smeared out to form a ring singularity that lies in the plane of rotation.[88] In both cases, the singular region has zero volume. It can also be shown that the singular region contains all the mass of the black hole solution.[89] The singular region can thus be thought of as having infinite density.[90]Observers falling into a Schwarzschild black hole (i.e., non-rotating and not charged) cannot avoid being carried into the singularity, once they cross the event horizon. They can prolong the experience by accelerating away to slow their descent, but only up to a limit.[91] When they reach the singularity, they are crushed to infinite density and their mass is added to the total of the black hole. Before that happens, they will have been torn apart by the growing tidal forces in a process sometimes referred to as spaghettification or the "noodle effect".[92]
In the case of a charged (Reissner–Nordström) or rotating (Kerr) black hole, it is possible to avoid the singularity. Extending these solutions as far as possible reveals the hypothetical possibility of exiting the black hole into a different spacetime with the black hole acting as a wormhole.[93] The possibility of traveling to another universe is, however, only theoretical since any perturbation would destroy this possibility.[94] It also appears to be possible to follow closed timelike curves (returning to one's own past) around the Kerr singularity, which leads to problems with causality like the grandfather paradox.[95] It is expected that none of these peculiar effects would survive in a proper quantum treatment of rotating and charged black holes.[96]
The appearance of singularities in general relativity is commonly perceived as signaling the breakdown of the theory.[97] This breakdown, however, is expected; it occurs in a situation where quantum effects should describe these actions, due to the extremely high density and therefore particle interactions. To date, it has not been possible to combine quantum and gravitational effects into a single theory, although there exist attempts to formulate such a theory of quantum gravity. It is generally expected that such a theory will not feature any singularities.[98][99]
Photon sphere
The photon sphere is a spherical boundary of zero thickness in which photons that move on tangents to that sphere would be trapped in a circular orbit about the black hole. For non-rotating black holes, the photon sphere has a radius 1.5 times the Schwarzschild radius. Their orbits would be dynamically unstable, hence any small perturbation, such as a particle of infalling matter, would cause an instability that would grow over time, either setting the photon on an outward trajectory causing it to escape the black hole, or on an inward spiral where it would eventually cross the event horizon.[100]While light can still escape from the photon sphere, any light that crosses the photon sphere on an inbound trajectory will be captured by the black hole. Hence any light that reaches an outside observer from the photon sphere must have been emitted by objects between the photon sphere and the event horizon.[100]
Ergosphere
The ergosphere of a black hole is a volume whose inner boundary is the black hole's oblate spheroid event horizon and a pumpkin-shaped outer boundary, which coincides with the event horizon at the poles but noticeably wider around the equator. The outer boundary is sometimes called the ergosurface.[101]
Objects and radiation can escape normally from the ergosphere. Through the Penrose process, objects can emerge from the ergosphere with more energy than they entered. This energy is taken from the rotational energy of the black hole causing the latter to slow.[103] A variation of the Penrose process in the presence of strong magnetic fields, the Blandford–Znajek process is considered a likely mechanism for the enormous luminosity and relativistic jets of quasars and other active galactic nuclei.
Innermost stable circular orbit (ISCO)
In Newtonian gravity, test particles can stably orbit at arbitrary distances from a central object. In general relativity, however, there exists an innermost stable circular orbit (often called the ISCO), inside of which, any infinitesimal perturbations to a circular orbit will lead to inspiral into the black hole.[104] The location of the ISCO depends on the spin of the black hole, in the case of a Schwarzschild black hole (spin zero) is:Formation and evolution
Given the bizarre character of black holes, it was long questioned whether such objects could actually exist in nature or whether they were merely pathological solutions to Einstein's equations. Einstein himself wrongly thought that black holes would not form, because he held that the angular momentum of collapsing particles would stabilize their motion at some radius.[106] This led the general relativity community to dismiss all results to the contrary for many years. However, a minority of relativists continued to contend that black holes were physical objects,[107] and by the end of the 1960s, they had persuaded the majority of researchers in the field that there is no obstacle to the formation of an event horizon.[citation needed]Gravitational collapse
Gravitational collapse occurs when an object's internal pressure is insufficient to resist the object's own gravity. For stars this usually occurs either because a star has too little "fuel" left to maintain its temperature through stellar nucleosynthesis, or because a star that would have been stable receives extra matter in a way that does not raise its core temperature. In either case the star's temperature is no longer high enough to prevent it from collapsing under its own weight.[111] The collapse may be stopped by the degeneracy pressure of the star's constituents, allowing the condensation of matter into an exotic denser state. The result is one of the various types of compact star. Which type forms depends on the mass of the remnant of the original star left after the outer layers have been blown away. Such explosions and pulsations lead to planetary nebula.[112] This mass can be substantially less than the original star. Remnants exceeding 5 M☉ are produced by stars that were over 20 M☉ before the collapse.[111]If the mass of the remnant exceeds about 3–4 M☉ (the Tolman–Oppenheimer–Volkoff limit[31]), either because the original star was very heavy or because the remnant collected additional mass through accretion of matter, even the degeneracy pressure of neutrons is insufficient to stop the collapse. No known mechanism (except possibly quark degeneracy pressure, see quark star) is powerful enough to stop the implosion and the object will inevitably collapse to form a black hole.[111]
While most of the energy released during gravitational collapse is emitted very quickly, an outside observer does not actually see the end of this process. Even though the collapse takes a finite amount of time from the reference frame of infalling matter, a distant observer would see the infalling material slow and halt just above the event horizon, due to gravitational time dilation. Light from the collapsing material takes longer and longer to reach the observer, with the light emitted just before the event horizon forms delayed an infinite amount of time. Thus the external observer never sees the formation of the event horizon; instead, the collapsing material seems to become dimmer and increasingly red-shifted, eventually fading away.[115]
Primordial black holes and the Big Bang
Gravitational collapse requires great density. In the current epoch of the universe these high densities are only found in stars, but in the early universe shortly after the Big Bang densities were much greater, possibly allowing for the creation of black holes. High density alone is not enough to allow black hole formation since a uniform mass distribution will not allow the mass to bunch up. In order for primordial black holes to have formed in such a dense medium, there must have been initial density perturbations that could then grow under their own gravity. Different models for the early universe vary widely in their predictions of the scale of these fluctuations. Various models predict the creation of primordial black holes ranging in size from a Planck mass to hundreds of thousands of solar masses.[110]Despite the early universe being extremely dense—far denser than is usually required to form a black hole—it did not re-collapse into a black hole during the Big Bang. Models for gravitational collapse of objects of relatively constant size, such as stars, do not necessarily apply in the same way to rapidly expanding space such as the Big Bang.[116]
High-energy collisions
Growth
Once a black hole has formed, it can continue to grow by absorbing additional matter. Any black hole will continually absorb gas and interstellar dust from its surroundings. This is the primary process through which supermassive black holes seem to have grown.[114] A similar process has been suggested for the formation of intermediate-mass black holes found in globular clusters.[122] Black holes can also merge with other objects such as stars or even other black holes. This is thought to have been important, especially in the early growth of supermassive black holes, which could have formed from the aggregation of many smaller objects.[114] The process has also been proposed as the origin of some intermediate-mass black holes.[123][124]Evaporation
In 1974, Hawking predicted that black holes are not entirely black but emit small amounts of thermal radiation at a temperature ℏ c3/(8 π G M kB);[53] this effect has become known as Hawking radiation. By applying quantum field theory to a static black hole background, he determined that a black hole should emit particles that display a perfect black body spectrum. Since Hawking's publication, many others have verified the result through various approaches.[125] If Hawking's theory of black hole radiation is correct, then black holes are expected to shrink and evaporate over time as they lose mass by the emission of photons and other particles.[53] The temperature of this thermal spectrum (Hawking temperature) is proportional to the surface gravity of the black hole, which, for a Schwarzschild black hole, is inversely proportional to the mass. Hence, large black holes emit less radiation than small black holes.[126]A stellar black hole of 1 M☉ has a Hawking temperature of 62 nanokelvins.[127] This is far less than the 2.7 K temperature of the cosmic microwave background radiation. Stellar-mass or larger black holes receive more mass from the cosmic microwave background than they emit through Hawking radiation and thus will grow instead of shrink.[128] To have a Hawking temperature larger than 2.7 K (and be able to evaporate), a black hole would need a mass less than the Moon. Such a black hole would have a diameter of less than a tenth of a millimeter.[129]
If a black hole is very small, the radiation effects are expected to become very strong. Even a black hole that is heavy compared to a human would evaporate in an instant. A black hole with the mass of a car would have a diameter of about 10−24 m and take a nanosecond to evaporate, during which time it would briefly have a luminosity of more than 200 times that of the Sun. Lower-mass black holes are expected to evaporate even faster; for example, a black hole of mass 1 TeV/c2 would take less than 10−88 seconds to evaporate completely. For such a small black hole, quantum gravitation effects are expected to play an important role and could hypothetically make such a small black hole stable, although current developments in quantum gravity do not indicate so.[130][131]
The Hawking radiation for an astrophysical black hole is predicted to be very weak and would thus be exceedingly difficult to detect from Earth. A possible exception, however, is the burst of gamma rays emitted in the last stage of the evaporation of primordial black holes. Searches for such flashes have proven unsuccessful and provide stringent limits on the possibility of existence of low mass primordial black holes.[132] NASA's Fermi Gamma-ray Space Telescope launched in 2008 will continue the search for these flashes.[133]
If black holes evaporate via Hawking radiation, a solar mass black hole will evaporate (beginning once the temperature of the cosmic microwave background drops below that of the black hole) over 1064 years.[134] A supermassive black hole with a mass of 1011 (100 billion) M☉ will evaporate in around 2×10100 years.[135] Some monster black holes in the universe are predicted to continue to grow up to perhaps 1014 M☉ during the collapse of superclusters of galaxies. Even these would evaporate over a timescale of up to 10106 years.[134]
Observational evidence
This section needs to be updated. In particular: the EHT team has revealed its results on 10 April 2019.April 2019)
( |
Prior to this, in 2015, the EHT detected magnetic fields just outside the event horizon of Sagittarius A*, and even discerned some of their properties. The existence of magnetic fields had been predicted by theoretical studies of black holes.[142][143]
Detection of gravitational waves from merging black holes
On 14 September 2015 the LIGO gravitational wave observatory made the first-ever successful direct observation of gravitational waves.[13][145] The signal was consistent with theoretical predictions for the gravitational waves produced by the merger of two black holes: one with about 36 solar masses, and the other around 29 solar masses.[13][146] This observation provides the most concrete evidence for the existence of black holes to date. For instance, the gravitational wave signal suggests that the separation of the two objects prior to the merger was just 350 km (or roughly 4 times the Schwarzschild radius corresponding to the inferred masses). The objects must therefore have been extremely compact, leaving black holes as the most plausible interpretation.[13]More importantly, the signal observed by LIGO also included the start of the post-merger ringdown, the signal produced as the newly formed compact object settles down to a stationary state. Arguably, the ringdown is the most direct way of observing a black hole.[147] From the LIGO signal it is possible to extract the frequency and damping time of the dominant mode of the ringdown. From these it is possible to infer the mass and angular momentum of the final object, which match independent predictions from numerical simulations of the merger.[148] The frequency and decay time of the dominant mode are determined by the geometry of the photon sphere. Hence, observation of this mode confirms the presence of a photon sphere, however it cannot exclude possible exotic alternatives to black holes that are compact enough to have a photon sphere.[147]
The observation also provides the first observational evidence for the existence of stellar-mass black hole binaries. Furthermore, it is the first observational evidence of stellar-mass black holes weighing 25 solar masses or more.[149]
On 15 June 2016, a second detection of a gravitational wave event from colliding black holes was announced,[150] and other gravitational wave events have since been observed.[15]
Proper motions of stars orbiting Sagittarius A*
The proper motions of stars near the center of our own Milky Way provide strong observational evidence that these stars are orbiting a supermassive black hole.[151] Since 1995, astronomers have tracked the motions of 90 stars orbiting an invisible object coincident with the radio source Sagittarius A*. By fitting their motions to Keplerian orbits, the astronomers were able to infer, in 1998, that a 2.6 million M☉ object must be contained in a volume with a radius of 0.02 light-years to cause the motions of those stars.[152] Since then, one of the stars—called S2—has completed a full orbit. From the orbital data, astronomers were able to refine the calculations of the mass to 4.3 million M☉ and a radius of less than 0.002 light years for the object causing the orbital motion of those stars.[151] The upper limit on the object's size is still too large to test whether it is smaller than its Schwarzschild radius; nevertheless, these observations strongly suggest that the central object is a supermassive black hole as there are no other plausible scenarios for confining so much invisible mass into such a small volume.[152] Additionally, there is some observational evidence that this object might possess an event horizon, a feature unique to black holes.[153]Accretion of matter
As such, many of the universe's more energetic phenomena have been attributed to the accretion of matter on black holes. In particular, active galactic nuclei and quasars are believed to be the accretion discs of supermassive black holes.[159] Similarly, X-ray binaries are generally accepted to be binary star systems in which one of the two stars is a compact object accreting matter from its companion.[159] It has also been suggested that some ultraluminous X-ray sources may be the accretion disks of intermediate-mass black holes.[160]
In November 2011 the first direct observation of a quasar accretion disk around a supermassive black hole was reported.[161][162]
X-ray binaries
If such a system emits signals that can be directly traced back to the compact object, it cannot be a black hole. The absence of such a signal does, however, not exclude the possibility that the compact object is a neutron star. By studying the companion star it is often possible to obtain the orbital parameters of the system and to obtain an estimate for the mass of the compact object. If this is much larger than the Tolman–Oppenheimer–Volkoff limit (that is, the maximum mass a neutron star can have before it collapses) then the object cannot be a neutron star and is generally expected to be a black hole.[159]
The first strong candidate for a black hole, Cygnus X-1, was discovered in this way by Charles Thomas Bolton,[163] Louise Webster and Paul Murdin[164] in 1972.[165][166] Some doubt, however, remained due to the uncertainties that result from the companion star being much heavier than the candidate black hole. Currently, better candidates for black holes are found in a class of X-ray binaries called soft X-ray transients. In this class of system, the companion star is of relatively low mass allowing for more accurate estimates of the black hole mass. Moreover, these systems are actively emit X-rays for only several months once every 10–50 years. During the period of low X-ray emission (called quiescence), the accretion disc is extremely faint allowing detailed observation of the companion star during this period. One of the best such candidates is V404 Cygni.[159]
Quiescence and advection-dominated accretion flow
The faintness of the accretion disc of an X-ray binary during quiescence is suspected to be caused by the flow of mass entering a mode called an advection-dominated accretion flow (ADAF). In this mode, almost all the energy generated by friction in the disc is swept along with the flow instead of radiated away. If this model is correct, then it forms strong qualitative evidence for the presence of an event horizon,[167] since if the object at the center of the disc had a solid surface, it would emit large amounts of radiation as the highly energetic gas hits the surface,[clarification needed] an effect that is observed for neutron stars in a similar state.[157]Quasi-periodic oscillations
The X-ray emissions from accretion disks sometimes flicker at certain frequencies. These signals are called quasi-periodic oscillations and are thought to be caused by material moving along the inner edge of the accretion disk (the innermost stable circular orbit). As such their frequency is linked to the mass of the compact object. They can thus be used as an alternative way to determine the mass of candidate black holes.[168]Galactic nuclei
It is now widely accepted that the center of nearly every galaxy, not just active ones, contains a supermassive black hole.[173] The close observational correlation between the mass of this hole and the velocity dispersion of the host galaxy's bulge, known as the M-sigma relation, strongly suggests a connection between the formation of the black hole and the galaxy itself.[174]
Microlensing (proposed)
Another way that the black hole nature of an object may be tested in the future is through observation of effects caused by a strong gravitational field in their vicinity. One such effect is gravitational lensing: The deformation of spacetime around a massive object causes light rays to be deflected much as light passing through an optic lens. Observations have been made of weak gravitational lensing, in which light rays are deflected by only a few arcseconds. However, it has never been directly observed for a black hole.[176] One possibility for observing gravitational lensing by a black hole would be to observe stars in orbit around the black hole. There are several candidates for such an observation in orbit around Sagittarius A*.[176]Alternatives
The evidence for stellar black holes strongly relies on the existence of an upper limit for the mass of a neutron star. The size of this limit heavily depends on the assumptions made about the properties of dense matter. New exotic phases of matter could push up this bound.[159] A phase of free quarks at high density might allow the existence of dense quark stars,[177] and some supersymmetric models predict the existence of Q stars.[178] Some extensions of the standard model posit the existence of preons as fundamental building blocks of quarks and leptons, which could hypothetically form preon stars.[179] These hypothetical models could potentially explain a number of observations of stellar black hole candidates. However, it can be shown from arguments in general relativity that any such object will have a maximum mass.[159]Since the average density of a black hole inside its Schwarzschild radius is inversely proportional to the square of its mass, supermassive black holes are much less dense than stellar black holes (the average density of a 108 M☉ black hole is comparable to that of water).[159] Consequently, the physics of matter forming a supermassive black hole is much better understood and the possible alternative explanations for supermassive black hole observations are much more mundane. For example, a supermassive black hole could be modelled by a large cluster of very dark objects. However, such alternatives are typically not stable enough to explain the supermassive black hole candidates.[159]
The evidence for the existence of stellar and supermassive black holes implies that in order for black holes to not form, general relativity must fail as a theory of gravity, perhaps due to the onset of quantum mechanical corrections. A much anticipated feature of a theory of quantum gravity is that it will not feature singularities or event horizons and thus black holes would not be real artifacts.[180] For example, in the fuzzball model based on string theory, the individual states of a black hole solution do not generally have an event horizon or singularity, but for a classical/semi-classical observer the statistical average of such states appears just as an ordinary black hole as deduced from general relativity.[181]
A few theoretical objects have been conjectured to match observations of astronomical black hole candidates identically or near-identically, but which function via a different mechanism. These include the gravastar, the black star (semiclassical gravity),[182] and the dark-energy star.[183]
Open questions
Entropy and thermodynamics
S = 1/4 c3k/Għ A
The link with the laws of thermodynamics was further strengthened by Hawking's discovery that quantum field theory predicts that a black hole radiates blackbody radiation at a constant temperature. This seemingly causes a violation of the second law of black hole mechanics, since the radiation will carry away energy from the black hole causing it to shrink. The radiation, however also carries away entropy, and it can be proven under general assumptions that the sum of the entropy of the matter surrounding a black hole and one quarter of the area of the horizon as measured in Planck units is in fact always increasing. This allows the formulation of the first law of black hole mechanics as an analogue of the first law of thermodynamics, with the mass acting as energy, the surface gravity as temperature and the area as entropy.[185]
One puzzling feature is that the entropy of a black hole scales with its area rather than with its volume, since entropy is normally an extensive quantity that scales linearly with the volume of the system. This odd property led Gerard 't Hooft and Leonard Susskind to propose the holographic principle, which suggests that anything that happens in a volume of spacetime can be described by data on the boundary of that volume.[186]
Although general relativity can be used to perform a semi-classical calculation of black hole entropy, this situation is theoretically unsatisfying. In statistical mechanics, entropy is understood as counting the number of microscopic configurations of a system that have the same macroscopic qualities (such as mass, charge, pressure, etc.). Without a satisfactory theory of quantum gravity, one cannot perform such a computation for black holes. Some progress has been made in various approaches to quantum gravity. In 1995, Andrew Strominger and Cumrun Vafa showed that counting the microstates of a specific supersymmetric black hole in string theory reproduced the Bekenstein–Hawking entropy.[187] Since then, similar results have been reported for different black holes both in string theory and in other approaches to quantum gravity like loop quantum gravity.[188]
Information loss paradox
Unsolved problem in physics:
Is physical information lost in black holes?
(more unsolved problems in physics)
|
The question whether information is truly lost in black holes (the black hole information paradox) has divided the theoretical physics community (see Thorne–Hawking–Preskill bet). In quantum mechanics, loss of information corresponds to the violation of vital property called unitarity, which has to do with the conservation of probability. It has been argued that loss of unitarity would also imply violation of conservation of energy.[190] Over recent years evidence has been building that indeed information and unitarity are preserved in a full quantum gravitational treatment of the problem.[191]
The firewall paradox
According to quantum field theory in curved spacetime, a single emission of Hawking radiation involves two mutually entangled particles. The outgoing particle escapes and is emitted as a quantum of Hawking radiation; the infalling particle is swallowed by the black hole. Assume a black hole formed a finite time in the past and will fully evaporate away in some finite time in the future. Then, it will only emit a finite amount of information encoded within its Hawking radiation. Assume that at time , more than half of the information had already been emitted. According to widely accepted research by physicists like Don Page[192][193] and Leonard Susskind, an outgoing particle emitted at time must be entangled with all the Hawking radiation the black hole has previously emitted. This creates a paradox: a principle called "monogamy of entanglement" requires that, like any quantum system, the outgoing particle cannot be fully entangled with two independent systems at the same time; yet here the outgoing particle appears to be entangled with both the infalling particle and, independently, with past Hawking radiation.[194]In order to resolve the paradox, physicists may eventually be forced to give up one of three time-tested theories: Einstein's equivalence principle, unitarity, or existing quantum field theory. One possible solution, which violates the equivalence principle, is that a "firewall" destroys incoming particles at the event horizon.[195] A 2016 analysis of LIGO data shows tentative signs of echoes caused by a fuzzy event horizon; such echoes may be possible in firewall or fuzzball theories but should not occur in classical general relativity. Over the next two years, additional LIGO data should establish whether the echoes were just random noise, or whether they are instead evidence of a violation of classical general relativity.[196]
See also
- Black brane
- Black hole complementarity
- Black Hole Initiative
- Black holes in fiction
- Black hole starship
- Black string
- BTZ black hole
- General relativity
- Kugelblitz (astrophysics)
- List of black holes
- List of nearest black holes
- Outline of black holes
- Sonic black hole, also Dumb hole
- Stellar black hole
- Supermassive black holes
- Susskind-Hawking battle
- Timeline of black hole physics
- White hole
- Wormhole
Notes
- In particular, he assumed that all matter satisfies the weak energy condition.
References
- Merali, Zeeya (2016). "LIGO black hole echoes hint at general-relativity breakdown". Nature. 540. doi:10.1038/nature.2016.21135. Archived from the original on 20 December 2016.
Further reading
Popular reading- Ferguson, Kitty (1991). Black Holes in Space-Time. Watts Franklin. ISBN 978-0-531-12524-3.
- Hawking, Stephen (1988). A Brief History of Time. Bantam Books, Inc. ISBN 978-0-553-38016-3.
- Hawking, Stephen; Penrose, Roger (1996). The Nature of Space and Time. Princeton University Press. ISBN 978-0-691-03791-2.
- Melia, Fulvio (2003). The Black Hole at the Center of Our Galaxy. Princeton U Press. ISBN 978-0-691-09505-9.
- Melia, Fulvio (2003). The Edge of Infinity. Supermassive Black Holes in the Universe. Cambridge U Press. ISBN 978-0-521-81405-8.
- Pickover, Clifford (1998). Black Holes: A Traveler's Guide. Wiley, John & Sons, Inc. ISBN 978-0-471-19704-1.
- Thorne, Kip S. (1994). Black Holes and Time Warps. Norton, W. W. & Company, Inc. ISBN 978-0-393-31276-8.
- Wheeler, J. Craig (2007). Cosmic Catastrophes (2nd ed.). Cambridge University Press. ISBN 978-0-521-85714-7.
- Carroll, Sean M. (2004). Spacetime and Geometry. Addison Wesley. ISBN 978-0-8053-8732-2., the lecture notes on which the book was based are available for free from Sean Carroll's website.
- Carter, B. (1973). "Black hole equilibrium states". In DeWitt, B. S.; DeWitt, C. Black Holes.
- Chandrasekhar, Subrahmanyan (1999). Mathematical Theory of Black Holes. Oxford University Press. ISBN 978-0-19-850370-5.
- Frolov, V. P.; Novikov, I. D. (1998). "Black hole physics".
- Frolov, Valeri P.; Zelnikov, Andrei (2011). Introduction to Black Hole Physics. Oxford: Oxford University Press. ISBN 978-0-19-969229-3. Zbl 1234.83001.
- Hawking, S. W.; Ellis, G. F. R. (1973). Large Scale Structure of space time. Cambridge University Press. ISBN 978-0-521-09906-6.
- Melia, Fulvio (2007). The Galactic Supermassive Black Hole. Princeton U Press. ISBN 978-0-691-13129-0.
- Misner, Charles; Thorne, Kip S.; Wheeler, John (1973). Gravitation. W. H. Freeman and Company. ISBN 978-0-7167-0344-0.
- Taylor, Edwin F.; Wheeler, John Archibald (2000). Exploring Black Holes. Addison Wesley Longman. ISBN 978-0-201-38423-9.
- Wald, Robert M. (1984). General Relativity. University of Chicago Press. ISBN 978-0-226-87033-5.
- Wald, Robert M. (1992). Space, Time, and Gravity: The Theory of the Big Bang and Black Holes. University of Chicago Press. ISBN 978-0-226-87029-8.
- Black holes Teviet Creighton, Richard H. Price Scholarpedia 3(1):4277. doi:10.4249/scholarpedia.4277
- Gallo, Elena; Marolf, Donald (2009). "Resource Letter BH-2: Black Holes". American Journal of Physics. 77 (4): 294–307. arXiv:0806.2316. Bibcode:2009AmJPh..77..294G. doi:10.1119/1.3056569.
- Hughes, Scott A. (2005). "Trust but verify: The case for astrophysical black holes". arXiv:hep-ph/0511217. Lecture notes from 2005 SLAC Summer Institute.
External links
- Black Holes on In Our Time at the BBC
- Stanford Encyclopedia of Philosophy: "Singularities and Black Holes" by Erik Curiel and Peter Bokulich.
- Black Holes: Gravity's Relentless Pull – Interactive multimedia Web site about the physics and astronomy of black holes from the Space Telescope Science Institute
- ESA's Black Hole Visualization
- Frequently Asked Questions (FAQs) on Black Holes
- "Schwarzschild Geometry"
- Hubble site
- Videos
- 16-year-long study tracks stars orbiting Milky Way black hole
- Movie of Black Hole Candidate from Max Planck Institute
- Nature.com 2015-04-20 3D simulations of colliding black holes
- Computer visualisation of the signal detected by LIGO
- Two Black Holes Merge into One (based upon the signal GW150914)
Languages
- Translation: Antoci, S.; Loinger, A. (1999). "On the gravitational field of a mass point according to Einstein's theory". arXiv:physics/9905030. and Schwarzschild, K. (1916). "Über das Gravitationsfeld einer Kugel aus inkompressibler Flüssigkeit nach der Einsteinschen Theorie". Sitzungsberichte der Königlich Preussischen Akademie der Wissenschaften. 18: 424–434.
- Translation: Antoci, S. (1999). "On the gravitational field of a sphere of incompressible fluid according to Einstein's theory". arXiv:physics/9912033.
The first conclusion was the Newtonian version of light not escaping; the second was a semi-accurate, relativistic description; and the third was typical Eddingtonian hyperbole ... when a star is as small as the critical circumference, the curvature is strong but not infinite, and space is definitely not wrapped around the star. Eddington may have known this, but his description made a good story, and it captured in a whimsical way the spirit of Schwarzschild's spacetime curvature."
It seems that the "black hole" label was also bandied about in January 1964 in Cleveland at a meeting of the American Association for the Advancement of Science. Science News Letter reporter Ann Ewing reported from that meeting, describing how an intense gravitational field could cause a star to collapse in on itself. "Such a star then forms a 'black hole' in the universe," Ewing wrote
eval
Jump to navigation
Jump to search
Using
programming languages,
Eval and apply are instances of meta-circular evaluators, interpreters of a language that can be invoked within the language itself.
In some eval
is a function which evaluates a string as though it were an expression and returns a result; in others, it executes multiple lines of code as though they had been included instead of the line including the eval
. The input to eval
is not necessarily a string; it may be structured representation of code, such as an abstract syntax tree (like Lisp forms), or of special type such as code
(as in Python). The analog for a statement is exec
,
which executes a string (or code in other format) as if it were a
statement; in some languages, such as Python, both are present, while in
other languages only one of either eval
or exec
is.
Eval and apply are instances of meta-circular evaluators, interpreters of a language that can be invoked within the language itself.
Contents
Security risks
eval
with data from an untrusted source may introduce security vulnerabilities. For instance, assuming that the get_data()
function gets data from the Internet, this Python code is insecure:
session['authenticated'] = False
data = get_data()
foo = eval(data)
"session.update('authenticated'=True)"
as data, which would update the session
dictionary to set an authenticated key to be True. To remedy this, all data which will be used with eval
must be escaped, or it must be run without access to potentially harmful functions.
Implementation
In interpreted languages,eval
is almost always implemented with the same interpreter as normal code. In compiled languages, the same compiler used to compile programs may be embedded in programs using the eval
function; separate interpreters are sometimes used, though this results in code duplication.
Programming languages
ECMAScript
JavaScript
In JavaScript,eval
is something of a hybrid between an expression evaluator and a
statement executor. It returns the result of the last expression
evaluated.
Example as an expression evaluator:
foo = 2;
alert(eval('foo + 2'));
foo = 2;
eval('foo = foo + 2;alert(foo);');
eval
is to parse JSON text, perhaps as part of an Ajax framework. However, modern browsers provide JSON.parse
as a more secure alternative for this task.
ActionScript
In ActionScript (Flash's programming language),eval
cannot be used to evaluate arbitrary expressions. According to the
Flash 8 documentation, its usage is limited to expressions which
represent "the name of a variable, property, object, or movie clip to
retrieve. This parameter can be either a String or a direct reference to
the object instance."
[1]
ActionScript 3 does not support eval.
The ActionScript 3 Eval Library[1] and the D.eval API[2] are ongoing development projects to create equivalents to
eval
in ActionScript 3.
Lisp
Lisp was the original language to make use of aneval
function in 1958. In fact, definition of the eval
function led to the first implementation of the language interpreter.[3]
Before the eval
function was defined, Lisp functions were manually compiled to assembly language statements. However, once the eval
function had been manually compiled it was then used as part of a simple read-eval-print loop which formed the basis of the first Lisp interpreter.
Later versions of the Lisp
eval
function have also been implemented as compilers.
The
eval
function in Lisp expects a form to be
evaluated and executed as argument. The return value of the given form
will be the return value of the call to eval
.
This is an example Lisp code:
; A form which calls the + function with 1,2 and 3 as arguments.
; It returns 6.
(+ 1 2 3)
; In lisp any form is meant to be evaluated, therefore
; the call to + was performed.
; We can prevent Lisp from performing evaluation
; of a form by prefixing it with "'", for example:
(setq form1 '(+ 1 2 3))
; Now form1 contains a form that can be used by eval, for
; example:
(eval form1)
; eval evaluated (+ 1 2 3) and returned 6.
eval
function. For example, to evaluate the content of a string, the string
would first have to be converted into a Lisp form using the read-from-string
function and then the resulting form would have to be passed to eval
:
(eval (read-from-string "(format t \"Hello World!!!~%\")"))
form1
contains the symbol +
.
Evaluation of this symbol must yield the function for addition to make
the example work as intended. Thus some dialects of lisp allow an
additional parameter for eval
to specify the context of evaluation (similar to the optional arguments to Python's eval
function - see below). An example in the Scheme dialect of Lisp (R5RS and later):
;; Define some simple form as in the above example.
(define form2 '(+ 5 2))
;Value: form2
;; Evaluate the form within the initial context.
;; A context for evaluation is called an "environment" in Scheme slang.
(eval form2 user-initial-environment)
;Value: 7
;; Confuse the initial environment, so that + will be
;; a name for the subtraction function.
(environment-define user-initial-environment '+ -)
;Value: +
;; Evaluate the form again.
;; Notice that the returned value has changed.
(eval form2 user-initial-environment)
;Value: 3
Perl
In Perl, theeval
function is something of a hybrid between an expression evaluator and a
statement executor. It returns the result of the last expression
evaluated (all statements are expressions in Perl programming), and
allows the final semicolon to be left off.
Example as an expression evaluator:
$foo = 2;
print eval('$foo + 2'), "\n";
$foo = 2;
eval('$foo += 2; print "$foo\n";');
eval
blocks, which serves as its exception handling mechanism (see Exception handling syntax#Perl). This differs from the above use of eval
with strings in that code inside eval
blocks is interpreted at compile-time instead of run-time, so it is not the meaning of eval
used in this article.
PHP
In PHP,eval
executes code in a string almost exactly as if it had been put in the file instead of the call to eval()
. The only exception is that errors are reported as coming from a call to eval()
, and return statements become the result of the function.
Unlike some languages, the argument to
eval
must be a string of one or more complete statements, not just expressions; however, one can get the "expression" form of eval
by putting the expression in a return statement, which causes eval
to return the result of that expression.
Unlike some languages, PHP's
eval
is a "language construct" rather than a function,[4] and so cannot be used in some contexts where functions can be, like higher-order functions.
Example using echo:
<?php
$foo = "Hello, world!\n";
eval('echo "$foo";');
?>
<?php
$foo = "Goodbye, world!\n"; //does not work in PHP5
echo eval('return $foo;');
?>
Lua
In Lua 5.1,loadstring
compiles Lua code into an anonymous function.
Example as an expression evaluator:
loadstring("print('Hello World!')")()
a = 1
f = loadstring("return a + 1") -- compile the expression to an anonymous function
print(f()) -- execute (and print the result '2')
loadstring
in favor of the existing load
function, which has been augmented to accept strings. In addition, it
allows providing the function's environment directly, as environments
are now upvalues.
print(load("print('Hello ' .. a)", "", "t", { a = "World!", print = print })())
PostScript
PostScript'sexec
operator takes an operand — if it is a simple literal it pushes it back
on the stack. If one takes a string containing a PostScript expression
however, one can convert the string to an executable which then can be
executed by the interpreter, for example:
((Hello World) =) cvx execconverts the PostScript expression
(Hello World) =which pops the string "Hello World" off the stack and displays it on the screen, to have an executable type, then is executed.
PostScript's
run
operator is similar in functionality but instead the interpreter interprets PostScript expressions in a file, itself.
Python
In Python, theeval
function in its simplest form evaluates a single expression.
eval
example (interactive shell):
>>> x = 1
>>> eval('x + 1')
2
>>> eval('x')
1
eval
function takes two optional arguments, global
and locals
, which allow the programmer to set up a restricted environment for the evaluation of the expression.
The
exec
statement (or the exec
function in Python 3.x) executes statements:
exec
example (interactive shell):
>>> x = 1
>>> y = 1
>>> exec "x += 1; y -= 1"
>>> x
2
>>> y
0
compile()
function and by telling it what kind of input it has to compile: an "exec
" statement, an "eval
" statement or a "single
" statement:
compile
example (interactive shell):
>>> x = 1
>>> y = 2
>>> eval (compile ("print 'x + y = ', x + y", "compile-sample.py", "single"))
x + y = 3
D
D is a statically compiled language and therefore does not include an "eval
" statement in the traditional sense, but does include the related "mixin
" statement. The difference is that, where "eval
" interprets a string as code at runtime, with a "mixin
" the string is statically compiled like ordinary code and must be known at compile time. For example:
import std.stdio;
void main() {
int num = 0;
mixin("num++;");
writeln(num); // Prints 1.
}
num++;
"
had been written directly instead of mixed in. The argument to mixin
doesn't need to be a string literal, but arbitrary expressions resulting
in a string value, including function calls, that can be evaluated at
compile time.
ColdFusion
ColdFusion'sevaluate
function lets you evaluate a string expression at runtime.
<cfset x = "int(1+1)">
<cfset y = Evaluate(x)>
<cfset x = Evaluate("queryname.#columnname#[rownumber]")>
Ruby
The Ruby programming language interpreter offers aneval
function similar to Python or Perl, and also allows a scope, or binding, to be specified.
Aside from specifying a function's binding,
eval
may
also be used to evaluate an expression within a specific class
definition binding or object instance binding, allowing classes to be
extended with new methods specified in strings.
a = 1
eval('a + 1') # (evaluates to 2)
# evaluating within a context
def get_binding(a)
binding
end
eval('a+1',get_binding(3)) # (evaluates to 4, because 'a' in the context of get_binding is 3)
class Test; end
Test.class_eval("def hello; return 'hello';end") # add a method 'hello' to this class
Test.new.hello # evaluates to "hello"
Forth
Most standard implementations of Forth have two variants ofeval
: EVALUATE
and INTERPRET
.
Win32FORTH code example:
S" 2 2 + ." EVALUATE \ Outputs "4"
BASIC
REALbasic
In REALbasic, there is a class called RBScript which can execute REALbasic code at runtime. RBScript is very sandboxed—only the most core language features are there, and you have to allow it access to things you want it to have. You can optionally assign an object to the context property. This allows for the code in RBScript to call functions and use properties of the context object. However, it is still limited to only understanding the most basic types, so if you have a function that returns a Dictionary or MySpiffyObject, RBScript will be unable to use it. You can also communicate with your RBScript through the Print and Input events.VBScript
Microsoft's VBScript, which is an interpreted language, has two constructs.Eval
is a function evaluator that can include calls to user-defined
functions. (These functions may have side-effects such as changing the
values of global variables.) Execute
executes one or more colon-separated statements, which can change global state.
Both VBScript and JScript
eval
are available to
developers of compiled Windows applications (written in languages which
do not support Eval) through an ActiveX control called the Microsoft
Script Control, whose Eval method can be called by application code. To
support calling of user-defined functions, one must first initialize the
control with the AddCode method, which loads a string (or a string
resource) containing a library of user-defined functions defined in the
language of one's choice, prior to calling Eval.
Visual Basic for Applications
Visual Basic for Applications (VBA), the programming language of Microsoft Office, is a virtual machine language where the runtime environment compiles and runs p-code. Its flavor of Eval supports only expression evaluation, where the expression may include user-defined functions and objects (but not user-defined variable names). Of note, the evaluator is different from VBS, and invocation of certain user-defined functions may work differently in VBA than the identical code in VBScript.Smalltalk
As Smalltalk's compiler classes are part of the standard class library and usually present at run time, these can be used to evaluate a code string.Compiler evaluate:'1 + 2'
Compiler evaluate:'Object subclass:#Foo'
Tcl
The Tcl programming language has a command calledeval
,
which executes the source code provided as an argument. Tcl represents
all source code as strings, with curly braces acting as quotation
marks, so that the argument to eval
can have the same formatting as any other source code.
set foo {
while {[incr i]<10} {
puts "$i squared is [expr $i*$i]"
}
}
eval $foo
Command-line interpreters
Unix shells
The eval command is present in all Unix shells, including the original "sh" (Bourne shell). It concatenates all the arguments with spaces, then re-parses and executes the result as a command. – FreeBSD General Commands ManualWindows PowerShell
In Windows PowerShell, theInvoke-Expression
Cmdlet serves the same purpose as the eval function in programming
languages like JavaScript, PHP and Python.
The Cmdlet runs any Windows PowerShell expression that is provided as a
command parameter in the form of a string and outputs the result of the
specified expression.
Usually, the output of the Cmdlet is of the same type as the result of
executing the expression. However, if the result is an empty array, it
outputs $null
. In case the result is a single-element
array, it outputs that single element. Similar to JavaScript, Windows
PowerShell allows the final semicolon to be left off.
Example as an expression evaluator:
PS > $foo = 2
PS > invoke-expression '$foo + 2'
PS > $foo = 2
PS > invoke-expression '$foo += 2; $foo'
Microcode
In 1966 IBM Conversational Programming System (CPS) introduced a microprogrammed functionEVAL
to perform "interpretive evaluation of expressions which are written in a modified Polish-string notation" on an IBM System/360 Model 50[5]
Microcoding this function was "substantially more than a factor of five
faster than a program to interpret an assignment statement."[6]
Theory
In theoretical computer science, a careful distinction is commonly made between eval and apply. Eval is understood to be the step of converting a quoted string into a callable function and its arguments, whereas apply is the actual call of the function with a given set of arguments. The distinction is particularly noticeable in functional languages, and languages based on lambda calculus, such as LISP and Scheme. Thus, for example, in Scheme, the distinction is between(eval '(f x) )
(apply f (list x))
Eval and apply are the two interdependent components of the eval-apply cycle, which is the essence of evaluating Lisp, described in SICP.[7]
In category theory, the eval morphism is used to define the closed monoidal category. Thus, for example, the category of sets, with functions taken as morphisms, and the cartesian product taken as the product, forms a Cartesian closed category. Here, eval (or, properly speaking, apply) together with its right adjoint, currying, form the simply typed lambda calculus, which can be interpreted to be the morphisms of Cartesian closed categories.
References
- The Metacircular Evaluator (SICP Section 4.1)
No comments:
Post a Comment