Commit 07b605e6 authored by Elias2049's avatar Elias2049
Browse files

Merge branch 'master' of https://gitlab.ocamlpro.com/OCamlPro/www into CssElias

parents e382d7f8 d45ccbf8
......@@ -18,7 +18,7 @@ build:
stage: build
image: registry.ocamlpro.com/ocamlpro/ocaml-docker-images:4.12
before_script:
- sudo apk add openssl-libs-static
- sudo apk add bash openssl-libs-static
- if [ -d _opam ]; then opam install . --deps-only --locked --depext-only -td;
else opam switch create . ocaml-system --deps-only --locked -td; fi
script:
......
......@@ -8,6 +8,8 @@ type article =
; url : string
}
exception ContentDoesntExistSoPleaseRaiseA404
let alt_ergo_footer =
{|
> ### **About Alt-Ergo**
......@@ -188,13 +190,13 @@ let article_of_string post url =
let authors =
let auth = get_meta_value author in
match String.split_on_char ',' auth with
| [ "" ] -> [ "Unspecified authors!" ]
| [ "" ] -> [ "Unspecified authors." ]
| auth -> auth
in
let tags =
let tags = get_meta_value tags in
match String.split_on_char ',' tags with
| [ "" ] -> [ "Unspecified tags!" ]
| [ "" ] -> [ "Unspecified tags." ]
| tags -> tags
in
let category =
......@@ -315,19 +317,19 @@ let pp_article_excerpt fmt article =
<h3><a href="/blog/%s">%s</a></h3>
</div>
<div class="row">
<div class="col-lg-3">
<div class="col-6 col-lg-3">
<img class="icon" src="/blog/assets/img/icon_person.svg"/>
Authors: %a
</div>
<div class="col-lg-3">
<div class="col-6 col-lg-3">
<img class="icon" src="/blog/assets/img/icon_calendar.svg"/>
Date: %4d-%02d-%02d
</div>
<div class="col-lg-3">
<div class="col-6 col-lg-3">
<img class="icon" src="/blog/assets/img/icon_category.svg"/>
Category: <a href="/blog/category/%s">%s</a>
</div>
<div class="col-lg-3">
<div class="col-6 col-lg-3">
<img class="icon" src="/blog/assets/img/icon_tags.svg"/>
Tags: %a
</div>
......@@ -356,22 +358,22 @@ let specific_article_header title authors (year, month, day) category tags =
Format.asprintf
{|<h1 id="page-title">%s</h1>
<div class="row">
<div class="col-lg-3">
<div class="col-6 col-lg-3">
<img class="icon" src="/blog/assets/img/icon_person.svg"/>
Authors: %a
</div>
<div class="col-lg-2">
<div class="col-6 col-lg-2">
<img class="icon" src="/blog/assets/img/icon_calendar.svg"/>
Date: %4d-%02d-%02d
</div>
<div class="col-lg-1" align="center">
<div class="col-6 col-lg-1" align="center">
<a href="/blog/feed"><img class="icon" src="/blog/assets/img/icon_atom_feed.svg"/></a>
</div>
<div class="col-lg-3">
<div class="col-6 col-lg-3">
<img class="icon" src="/blog/assets/img/icon_category.svg"/>
Category: <a href="/blog/category/%s">%s</a>
</div>
<div class="col-lg-3">
<div class="col-6 col-lg-3">
<img class="icon" src="/blog/assets/img/icon_tags.svg"/>
Tags: %a
</div>
......@@ -394,6 +396,9 @@ let given_category category =
(fun article -> String.equal (normalize_url article.category) category)
articles_by_date
in
match articles_of_category with
| [] -> raise ContentDoesntExistSoPleaseRaiseA404
| _l ->
let category = (List.hd articles_of_category).category in
Format.asprintf {|<h1 id="page-title">Articles on %s</h1>%s%a@.|} category
links_to_home_pages pp_blog_posts articles_of_category
......@@ -410,6 +415,9 @@ let given_author ocp_author =
article.authors )
articles_by_date
in
match articles_of_author with
| [] -> raise ContentDoesntExistSoPleaseRaiseA404
| _l ->
let authors = (List.hd articles_of_author).authors in
let author =
List.find (fun auth -> String.equal (normalize_url auth) ocp_author) authors
......@@ -429,6 +437,9 @@ let given_tag tag =
article.tags )
articles_by_date
in
match articles_with_tag with
| [] -> raise ContentDoesntExistSoPleaseRaiseA404
| _l ->
let tag =
List.find
(fun t -> String.equal (normalize_tag t) tag)
......
This diff is collapsed.
This diff is collapsed.
......@@ -21,7 +21,7 @@ body {
color: #5a5a5a;
background-color: #EEEEEE;
line-height: 1.6;
font-size: 18px;
font-size: 21px;
}
p img {
......@@ -38,15 +38,6 @@ p img {
text-align: center;
}
.toplinks2 {
float: left;
}
.toplinks3 {
float: left;
margin-left: 140px;
}
h1, h2 {
font-family: "Fontin-Bold"; /*Seems a little bit too 'boudiné' : not beautiful on smartphones and tabs*/
}
......@@ -59,6 +50,18 @@ h1, h2 {
border-radius: 12px;
}
.blockquote-footer::before {
content: "";
}
.blockquote-footer {
margin-top: -1rem;
margin-bottom: 1rem;
font-size: .875em;
color: #6c757d;
text-align: center;
}
.featurette-divider {
margin: 5rem 0;
}
......@@ -217,6 +220,7 @@ img.feed {
.card-title {
text-align: center;
font-family: "Fontin";
margin-top: 10px;
}
.h3, h3 {
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
......@@ -59,3 +59,22 @@ File "/home/mi/Bureau/po.why", line 3017, characters 1-2450:Valid (0.8750) (222)
[ Acknowledgement: this work is financially supported by the [BWare project](https://bware.lri.fr/). ]
# Comments
Joshua Pratt (10 January 2020 at 5 h 20 min):
> Can the compiled alt-ergo.js be uploaded to npm? I’d love to use it in a web page I’m working on.
OCamlPro (6 March 2020 at 16 h 03 min):
> Hi Joshua, thanks for passing by 🙂 We have no plans of building a bridge between a version of Alt-Ergo in JS and npm. However, you can tweak Alt-Ergo to suit your needs! We would recommend taking a look at Try Why3 http://why3.lri.fr/try/, where you will find a JavaScript version of Alt-Ergo. You can follow their instructions to build Alt-Ergo in JavaScript https://gitlab.inria.fr/why3/why3/tree/master/src/trywhy3
Bharat Jayaraman (26 February 2020 at 17 h 37 min):
> This is VERY USEFUL tool!
>
> I am using it in a course on software verification here in Buffalo. It’s great for checking verification conditions.
>
> Many thanks,
> Bharat
OCamlPro (6 March 2020 at 16 h 04 min):
> Hi Bharat! Thank you for your message, we are always glad to hear from our users! If you feel so inclined, you can drop us an email at alt-ergo@ocamlpro.com to tell us more about your experience with Alt-Ergo and any feedback you may have.
......@@ -325,3 +325,23 @@ For some low level packed bitfield manipulation you can have a look at [some mor
## Conclusion
So if you want to write non allocating code in OCaml, turn everything in CPS, add additional arguments everywhere, turn your sum types in unboxed GADTs, manipulate a single large bigarrays. And enjoy !
# Comments
Gaetan Dubreil (3 April 2016 at 11 h 16 min):
> Thank you for this attractive and informative post.
> Just to be sure, is it not ‘t’ rather than ‘l’ that must be past to the fold_left function?
> You said “we only have tail calls now” but I don’t see any none tail calls in the first place, am I wrong?
Pierre Chambart (4 April 2016 at 14 h 48 min):
> There where effectively some typos. Thanks for noticing.
>
> There is one non-tail call in fold_left: the call to f. But effectively the recursion is tail.
kantien (25 May 2016 at 13 h 57 min):
> Interesting article, but i have one question. Can we say, from the proof theory point of view, that turning the code in CPS style not to allocate is just an application of the Gentzen’s cut-elimination theorem ?
> I explain in more details this interpretation : if we have a proof P1 of the proposition A and a proof P2 of the proposition A ⇒ B, we can produce a proof P3 of proposition B by applying the cut rule or modus ponens, but the theorem says that we can eliminate the use of cut rule and produce a direct proof P4 of the proposition B. But modus ponens (or cut rule) is just the rule for typing function application : if f has type ‘a -> ‘b and x has type ‘a then f x has type ‘b. And so the cut-elimination theorem says that we can produce an object of type ‘b without allocate an object of type ‘a (this is not necessary to produce the P1 proof, or more exactly this is not necessary to put the P1’s conclusion in the environment in order to use it as a premise of the P2 proof ). Am I right ?
jdxu (4 January 2021 at 11 h 36 min):
> Very useful article. BTW, is there any document/tutorial/article about cmm syntax?
......@@ -130,3 +130,22 @@ works.
> NOTE: this article is cross-posted on [opam.ocaml.org](https://opam.ocaml.org/blog/) and [ocamlpro.com](/blog).
# Comments
Louis Gesbert (16 March 2017 at 14 h 31 min):
> Some discussion on a better naming and making some parts of this more widely available in the opam CLI is ongoing at https://github.com/ocaml/opam/issues/2882
Hez Carty (16 March 2017 at 17 h 23 min):
> Is it possible/planned to support sharing of compilers across local (or global) switches? It would be very useful to have a global 4.04.0+flambda switch including only the compiler itself or the compiler + basic tools like ocp-indent and merlin. Then a number of projects could share this base installation but have their own locally installed dependencies without duplicating the entire build time per-project.
Louis Gesbert (17 March 2017 at 10 h 10 min):
> Sharing compilers, or other packages across switches is not supported at the moment. However:
>
> You can still use the global `system compiler` on any switch, local or not, to avoid its recompilation
> What is planned, as a first step, for after the 2.0 release, is to add a cache of compiled packages. Hooks are already in place to allow this, and opam is able to track the files installed by each package already, so the most difficult part is probably going to be the relocation issues with OCaml itself.
>
> A cache is an easier solution to warrant consistency: with shared switches, the problem of reinstallations and keeping everything consistent gets much more complex — what happens when you change the compiler of your “master” switch ?
Hez Carty (20 March 2017 at 16 h 46 min):
> That sounds great, thank you. Should make this kind of local switch more useful when working with large numbers of projects.
......@@ -399,3 +399,9 @@ And that's it !
Of course that's a bit cheating since the program is not executable, but who cares really ?
If you want to use it, I made a small (ugly) [script](https://gist.github.com/chambart/15b18770d2368cc703a32f18fe12d179) generating those types. You can try it on bigger problems, but in fact it is a bit exponential. So you shouldn't really expect an answer too soon.
# Comments
Louis Gesbert (28 April 2017 at 8 h 11 min):
> Brilliant!
......@@ -108,3 +108,16 @@ still need to install tools that are tightly bound to a compiler version, like
> [opam.ocaml.org](https://opam.ocaml.org/blog/) and
> [ocamlpro.com](/blog).
# Comments
Jeremie Dimino (11 May 2017 at 8 h 27 min):
> Thanks, that seems like a useful feature. Regarding relocation of the compiler, shouldn’t it be enough to set the environment variable OCAMLLIB? AFAIK the stdlib directory is the only hardcoded path on the compiler.
Louis Gesbert (11 May 2017 at 8 h 56 min):
> Last I checked, there were a few more problematic points, in particular generated bytecode executables statically referring to their interpreter; but yes, in any case, it’s worth experimenting in that direction using the new hooks, to see how it works in practice.
Jeremie Dimino (12 May 2017 at 9 h 13 min):
> Indeed, I remember that we had a similar problem in the initial setup to test the public release of Jane Street packages: we were using long paths for the opam roots and the generated #! where too long for the OS… What I did back then is write a program that scanned the tree and rewrote the #! to use “#!/usr/bin/env ocamlrun”.
>
> That could be an option here. The rewriting only need to be done once, since the compiler uses `ocamlc -where`/camlheader when generating a bytecode executable.
......@@ -71,3 +71,15 @@ A few other new options have been added to `opam install` and related commands,
- `opam install --working-dir` uses the working directory state of your project, instead of the state registered in the version control system. Don't worry, opam will warn you if you have uncommitted changes and forgot to specify `--working-dir`.
> NOTE: this article is cross-posted on [opam.ocaml.org](https://opam.ocaml.org/blog/) and [ocamlpro.com](/blog).
# Comments
Hez Carty (4 May 2017 at 21 h 30 min):
> Would a command like “opam init $DIR” and “opam init $DIR –deps-only” work for an auto-intialization interface? Ideally creating the equivalent to a bare .opam/ using $DIR as $OPAMROOT + install a local switch + “opam install .” (with –deps-only if specified) under the newly created switch.
Louis Gesbert (5 May 2017 at 7 h 50 min):
> `opam init DIR` is currently used and means “use DIR as your initial, default package repository”.
> Overloading `opam init` sounds like a good approach though, esp. since the default of the command is already to create an initial switch. But a new flag, e.g. `opam init –here`, could be used to mean: do `opam init –bare` (it’s idempotent), `opam switch create .` and then `opam install .`.
>
> The issue that remains is inherent to compound commands: we would have to port e.g. the `–deps-only` option to `opam init`, making the interface and doc heavier, and it would only make sense in this specific use-case ; either that or limit the expressivity of the compound command, requiring people to fallback to the individual ones when they need some more specific features.
......@@ -263,3 +263,26 @@ We have seen how to compile, deploy, call and examine Liquidity contracts on the
- Slides in [English](https://files.ocamlpro.com/pub/liquidity_slides.en_.pdf)
- and [French](https://files.ocamlpro.com/pub/liquidity_slides.pdf)
# Comments
fredcy (9 February 2018 at 3 h 14 min):
> It says “Here we define a type abbreviation votes […]” but I don’t see any `votes` symbol in the nearby code.
>
> [Still working through the document. I’m eager to try Liquidity rather than write in Michelson.]
alain (9 February 2018 at 7 h 18 min):
> You are right, thanks for catching this. I’ve updated the contract code to use type `votes`.
branch (26 February 2019 at 18 h 28 min):
> Why the “Deploy” button can be inactive, while liquidity contract is compiled successfully?
alain (6 March 2019 at 15 h 09 min):
> For the Deploy button to become active, you need to specify an initial value for the storage directly in the code of the smart contract. This can be done by writing a constant directly or a function.
```sourcecode
let%init storage = (* the value of your initial storage*)
let%init storage x y z = (* the value of your initial storage, function of x, y and z *)
```
......@@ -283,3 +283,18 @@ tezos-client transfer 10 from my_account to KT1GgUJwMQoFayRYNwamRAYCvHBLzgorLoGo
**Alain Mebsout**: Alain is a senior engineer at OCamlPro. Alain was involved in Tezos early in 2017, participating in the design of the ICO infrastructure and in particular, the Bitcoin and Ethereum smart contracts. Since then, Alain has been developing the Liquidity language, compiler and online editor, and has started working on the verification of Liquidity smart contracts. Alain also contributed some code in the Tezos node to improve Michelson. Alain holds a PhD in Computer Science on formal verification of programs.
# Comments
Luiz Milfont (14 December 2018 at 17 h 21 min):
> Hello Mr. Alain Mebsout. My name is Milfont and I am the author of TezosJ SDK library, that allows to interact with Tezos blockchain through Java programming language.I did’t know this game before and got interested. I wonder if you would like me to create an Android version of your game, that would be an Android APP that would create a wallet automatically for the player and then he would pull a jackpot handle, sending the transaction with the parameters to your smart contract. I would like to know if you agree with this, and allow me to do it, using your already deployed game. Thanks in advance. Milfont. Twitter: @luizmilfont
michsell (1 October 2019 at 15 h 29 min):
> Hello Alain,
>
> I just played the game you designed, the problem is I cannot get any feedback even that 1utz for losing the game. Is the game retired? If so, can anyone help to remove it from tzscan dapps page: https://tzscan.io/dapps. Also, by any chance I may get the tezzies back…
>
> Many thanks!
> Best regards,
> Michshell
......@@ -335,3 +335,12 @@ signature in the run, preapply and injection RPCs ?
If we can reply to these questions, we will also be able to sign
operations offline.
# Comments
lizhihohng (5 May 2019 at 6 h 59 min):
> Before forge or sign a transaction, how to get a gas or gas limit, not a hard gas limit from contants?
Juliane (16 November 2019 at 15 h 29 min):
> Good answer back in return of this difficulty with solid arguments and explaining all on the topic of that.
title=Introduction aux RPCs dans Tezos : exemple d’un portefeuille (wallet) simple
authors=Fabrice Le Fessant
date=2018-11-20
category=Blockchains
tags=tezos,rpc,fr
Dans cet article technique, nous introduisons brièvement les RPCs dans Tezos à travers un exemple simple montrant comment le client Tezos
interagit avec le noeud lors d’une instruction de transfert. Les RPCs de Tezos sont des requêtes HTTP (GET ou POST) auxquelles les noeuds Tezos
répondent dans un fichier au format JSON. Elles sont la seule façon pour les wallets d’interagir avec [Read more…](/2018/11/15/an-introduction-to-tezos-rpcs-a-basic-wallet/)
......@@ -212,4 +212,72 @@ Secp256k1 keys (same as Bitcoin/Ethereum) and `tz3` for P256 keys;
finally, a realistic wallet would probably use cryptographic chips, on
a mobile phone or an external device (Ledger, etc.).
# Comments
Anthony (28 November 2018 at 2 h 01 min):
> Fabrice, you talk about signing the operation using tezos-client, which can then be used with the run_operation, however when . you talk about doing it in a script, it doesn’t include the edsig or checksum or converted back into a usable form for run_operations. Can you explain how this is done in a script?
>
> Thanks
> Anthony
Fabrice Le Fessant (29 November 2018 at 15 h 07 min):
> You are right, `run_operation` needs an `edsig` signature, not the hexadecimal encoding. To generate the `edsig`, you just need to use the reverse operation of `base58check.b58decode`, i.e. `base58check.b58encode`, on the concatenation of 3 byte arrays:
>
> 1/ the 5-bytes prefix that will generate the initial `edsig` characters, i.e. `0x09f5cd8612` in hexadecimal
> 2/ the raw signature `s`
> 3/ the 4 initial bytes of a checksum: the checksum is computed as `sha256(sha256(s))`
Badalona (27 December 2018 at 13 h 13 min):
> Hi Fabrice.
>
> I will aprreciate if you show the coding of step 3. My checksum is always wrong.
>
> Thanks
Alain (16 January 2019 at 16 h 26 min):
> The checksum is on prefix + s.
> Here is a python3 script to do it:
>
> ./hex2edsig.py 637e08251cae646a42e6eb8bea86ece5256cf777c52bc474b73ec476ee1d70e84c6ba21276d41bc212e4d878615f4a31323d39959e07539bc066b84174a8ff0dedsigtkpiSSschcaCt9pUVrpNPf7TTcgvgDEDD6NCEHMy8NNQJCGnMfLZzYoQj74yLjo9wx6MPVV29CvVzgi7qEcEUok3k7AuMg
```python
from pyblake2 import blake2b
import hashlib
import base58check
import ed25519
import sys
def sha256 (x) :
return hashlib.sha256(x).digest()
def b58check (prefix, b) :
x = prefix + b
checksum = sha256(sha256(x))[0:4]
return base58check.b58encode(x + checksum)
edsig_prefix = bytes([9, 245, 205, 134, 18])
hexsig = sys.argv[1]
bytessig = bytes.fromhex(hexsig)
b58sig = b58check (edsig_prefix, bytessig)
print(b58sig.decode('ascii'))
```
Anthony (29 November 2018 at 21 h 49 min):
> Fabrice,
> Thanks for the information would you be able to show the coding as you have done in your blog?
> Thanks
> Anthony
Mark Robson (9 February 2020 at 23 h 51 min):
> Great information, but can the article be updated to include the things discussed in the comments? As I can’t see the private key of bootstrap1 I can’t replicate locally. Been going around in circles on that point
stacey roberts (7 May 2020 at 13 h 53 min):
> Can you help me to clear about how tezos can support to build a fully decentralized supply chain eco system?
leesadaisy (16 September 2020 at 10 h 25 min):
> Hi there! Thanks for sharing useful info. Keep up your work.
Alice Jenifferze (17 September 2020 at 10 h 51 min):
> Thanks for sharing!
......@@ -123,3 +123,11 @@ in the public Tezos code base. We will inform you as soon as our Pull
Request is ready, for more testing ! If all testing and review goes
well, we hope it can be merged in the next release !
# Comments
Jack (30 January 2019 at 15 h 30 min):
> Please release this as a MR on gitlab so those of us not using docker can start testing the code.
Fabrice Le Fessant (10 February 2019 at 15 h 39 min):
> That was done: [here](/2019/02/04/improving-tezos-storage-gitlab-branch-for-testers/)
title=Tezos et OCamlPro
authors=Fabrice Le Fessant
date=2019-01-31
category=Blockchains
tags=tezos,OCamlPro,fr
Tezos est aujourd’hui un projet open source, un réseau international développé par des équipes sur plus de cinq continents. Dans la genèse du
projet, l’entreprise française OCamlPro, qui développe encore aujourd’hui de nombreux projets liés à Tezos (TZscan, Liquidity, etc.), a
joué un rôle particulièrement important. C’est en effet en son sein que des ingénieurs-chercheurs ont posé les premières pierres du code, en
étroite collaboration avec Arthur Breitman, l’architecte du projet, et DLS pendant plusieurs années. Nous nous réjouissons aujourd’hui de
l’essor qu’a pris le projet.
Arthur et OCamlPro
(publication conjointe)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment