У нас вы можете посмотреть бесплатно How OCaml Represents Values in Memory или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
OCaml has a remarkably simple memory model, permitting a uniform representation of both atomic and compound datatypes. It is often useful to understand the layout of OCaml values, particularly for debugging and optimization. This video explains the implementation choices behind various OCaml datatypes, without covering anything specific to Jane Street’s extensions. The examples in this video use some functions from the “Obj” module (https://ocaml.org/manual/5.2/api/Obj...., exposing details of the runtime’s internal representation of values. In particular, “Obj.repr” is an identity operation which reinterprets an OCaml value as an “Obj.t”, allowing us to inspect it via other functions in “Obj”, while “Obj.magic” unsafely reinterprets an OCaml value as having any arbitrary type. This video also uses relatively verbose syntax to redefine certain types, such as “type nonrec unit : immediate = unit = ()”. The keyword “nonrec” indicates that this definition is non-recursive, i.e. the second “unit” does not refer to the “first” but to the built-in “unit” in the typing environment. The “: immediate” annotation is a Jane Street extension, but is equivalent to the “[@@immediate]” attribute in mainstream OCaml. Finally, the “= ()” simply enumerates all constructors of the datatype, for illustration purposes. The manual section on type declaration syntax can be found here: https://ocaml.org/manual/5.2/typedecl.... Adapted from Real World OCaml: https://dev.realworldocaml.org/runtim...